Jump to content

Recommended Posts

Posted

Hi all,

I'm trying to create custom radio buttons. Basically, if I could simply color the dot of the checked radio button (orange), I would be satisfied. So, for the moment, I'm stuck with using an icon+label solution which isn't elegant at all. I'm wondering if there's a better way to do this than what I have below. I'm just using random shell32 icons as the example here.

Any help is greatly appreciated. Thanks!

Dim $iIcon_Checked = 15
Dim $iIcon_Unchecked = 0

Dim $bCheck1 = True
Dim $bCheck2 = False

$hGUI = GUICreate("Test GUI", 200, 200)
$idIcon1 = GUICtrlCreateIcon("shell32.dll", $iIcon_Checked, 10, 10, 13, 13)
$idLabel1 = GUICtrlCreateLabel("Radio 1", 25, 11, 60)
; -------
$idIcon2 = GUICtrlCreateIcon("shell32.dll", $iIcon_Unchecked, 10, 30, 13, 13)
$idLabel2 = GUICtrlCreateLabel("Radio 2", 25, 31, 60)

GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case -3
            ExitLoop
        Case $idIcon1, $idLabel1
            $bCheck1 = Not $bCheck1
            If $bCheck1 Then
                GUICtrlSetImage($idIcon1, "shell32.dll", $iIcon_Checked)
                GUICtrlSetImage($idIcon2, "shell32.dll", $iIcon_Unchecked)
            Else
                GUICtrlSetImage($idIcon1, "shell32.dll", $iIcon_Unchecked)
                GUICtrlSetImage($idIcon2, "shell32.dll", $iIcon_Checked)
            EndIf
        Case $idIcon2, $idLabel2
            $bCheck2 = Not $bCheck2
            If $bCheck2 Then
                GUICtrlSetImage($idIcon1, "shell32.dll", $iIcon_Unchecked)
                GUICtrlSetImage($idIcon2, "shell32.dll", $iIcon_Checked)
            Else
                GUICtrlSetImage($idIcon1, "shell32.dll", $iIcon_Checked)
                GUICtrlSetImage($idIcon2, "shell32.dll", $iIcon_Unchecked)
            EndIf
    EndSwitch
WEnd

 

Posted

I belive it's part of the explorer, and it's a pain to change, it would change system-wide.

The solution you presented is what i was going to suggest, and it's not even that hard to implement.

Create the icons and use them.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

I guess my hopes were two-fold here. I was hoping that either:

  • There was a way to simply color the dot in the radio button when checked (understood that it would be system-wide)
  • Or someone had created a UDF that simplifies the way I've displayed above into a neat & portable function as I find the bools to check the state "messy"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...