Jump to content
Sign in to follow this  

Coloring radio button

Recommended Posts


Help says

"Checkbox, Radio or Progress controls cannot be painted if the "Windows XP style" is used."

What does it mean?

Share this post

Link to post
Share on other sites

Windows XP Style is a.. style of windows displaying itself, I guess.

Posted Image

as opposed to Windows Classic style..

Posted Image

Share this post

Link to post
Share on other sites

As related to Autoit, this little UDF will do what you need and replace the users original settings

#include <GUIConstants.au3>
Dim $XS_n

GUICreate("My GUI Checkbox")  ; will create a dialog box that when displayed is centered
If XPStyle(1) Then MsgBox(0,0,"on", 2)
$checkCN = GUICtrlCreateRadio("Radio 1", 10, 10, 120, 15)
GUICtrlSetColor($checkCN, 0xFF0000)
GUICtrlSetBkColor($checkCN, 0x000000);0xFFFFFF)
If XPStyle(0) Then MsgBox(0,0,"off", 2)
GUISetState()       ; will display an  dialog box with 1 checkbox

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Func XPStyle($OnOff = 1)   
    If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return 1
    ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
        $XS_n = ""
        Return 1
    Return 0
EndFunc   ;==>XPStyle


Edited by Valuater


Share this post

Link to post
Share on other sites

I found this in Big Daddy's Absolute Lyrics Finder. It might help

    Turn window themes off for the GUI Controls.
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 1)
$GUI = GUICreate("Absolute Lyrics Finder  -=Big_Daddy Style=-", 586, 521, $iWinPosX, $iWinPosY)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUISetIcon($TempDir & "favicon.ico")

Code derived from:

AbsoluteLyricsFinder.au3 v1.2.1.1 Dec. 18, 2007

Bob Anthony (big_daddy)

;Ultimate Anti-Virus Removal Tool

$ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.")

If $ans = 6 Then
ElseIf $ans = 7 Then

Share this post

Link to post
Share on other sites

That DLLCall is very nice, thanks for sharing :)

What goes around comes around... Payback's a bitch.

Share this post

Link to post
Share on other sites

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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.