Sign in to follow this  
Followers 0
MiserableLife

[Solved]colouring a checkbox

3 posts in this topic

#1 ·  Posted (edited)

hello all,

How do you make a coloured checkbox in autoit?

I've tried to make one by making a checkbox and a label... but I think there must be a better way to do it....

Help file:

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

Sucessed code:

#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)

$GUI = GUICreate("")

GUISetBkColor ( 0x003300 , $GUI );Dark green

$Checkbox = GUICtrlCreateCheckbox ("",20,20,15,15)
$Label = GUICtrlCreateLabel("I'm a label.",40,20)
GUICtrlSetColor ( $Label , 0xFFCC33);orange

GUICtrlSetOnEvent($label,"OnEvent_Label")
GUISetState(@SW_SHOW)

While 1
    sleep(100)
WEnd

Func OnEvent_Label()
    If GUICtrlRead ($Checkbox) = $GUI_CHECKED Then 
        GUICtrlSetState($Checkbox,$GUI_UNCHECKED)
    Else
        GUICtrlSetState($Checkbox,$GUI_CHECKED)
    EndIf
EndFunc

Failed Code:

GUICreate("")

$Checkbox = GUICtrlCreateCheckbox ('Shortcut on Desktop',20,20)
GUICtrlSetColor ( $Checkbox , 0xFFCC33);orange
    
GUISetState(@SW_SHOW)

While 1
    sleep(100)
WEnd
Edited by MiserableLife

Share this post


Link to post
Share on other sites



= =""

I think I've asked the wrong question....

Thanks!

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  
Followers 0