Jump to content

problem with checkbox font color


deathday
 Share

Recommended Posts

I think there is a problem with checkbox font color , i try to change the font color of checkbox but i couldn't change it , there maybe be something wrong i don't know , i created a checkbox using Koda and the i tried Guictrlsetcolor to change the font color to white but its not changing .i have played with it for hours but no lcuk , can anyone tell what i am doing wrong .....

Link to comment
Share on other sites

I think there is a problem with checkbox font color , i try to change the font color of checkbox but i couldn't change it , there maybe be something wrong i don't know , i created a checkbox using Koda and the i tried Guictrlsetcolor to change the font color to white but its not changing .i have played with it for hours but no lcuk , can anyone tell what i am doing wrong .....

Better to provide some sample code you have which we can work around. Without some code it can be impossible to know what you are doing wrong, and it means that to provide an example we have to write it from scratch rather than modify your code, so we have to do more work than we should to help you. Please bear this in mind next time :)

In XP the XP theme takes control of the colour of the font for checkboxes, so you have to turn XP themes off when you create the checkbox.

#include <GuiConstants.au3>
 #include <windowsconstants.au3>
 Global $XS_n
 
 $Gui = GuiCreate("Test")
 GUISetBkColor(0xa9a9a8)
 
 XPStyleToggle(1);turn xp themes off
 $RadioButton = GUICtrlCreateCheckbox("Example checkbox",20,40,110,20)
;GUICtrlCreateRadio("Text", 20, 40, 40)
 GUICtrlSetColor(-1, 0xFF0000)
 XPStyleToggle(0);turn XP themes on again
 
 GUICtrlCreateGroup("group 1",10,60,300,200)
 
 GUICtrlSetColor(-1, 0xFFFFFF)
 GUICtrlCreateLabel("",20,70,300,50,$WS_CLIPSIBLINGS)
 GUICtrlSetBkColor(-1,0xffff00)
;GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
 
 GUISetState()
 GUISetBkColor(0xffff00)
 
 While 1
     $Msg = GUIGetMsg()
     Switch $Msg
         Case $GUI_EVENT_CLOSE
             Exit
     EndSwitch
 WEnd
 
 Func XPStyleToggle($Off = 1)
     If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0
      
     If $Off Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
         DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
         Return 1
     ElseIf IsArray($XS_n) Then
         DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
         $XS_n = ""
         Return 1
     EndIf
     Return 0
 EndFunc
Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

cool info , ididnt knw that before , thanks yo ,, i will keep that in mind for sure, by the way why cant autoit turn off the xp them colcor when we us check box ?i havent seen that info in helpfile, i have gone through th helpfile alot but havent came acroos suhc an info , thanks again...its really an important info...

Edited by deathday
Link to comment
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
 Share

  • Recently Browsing   0 members

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