nikink Posted June 23, 2008 Posted June 23, 2008 Hi folks. Yet again I have a gui problem. Using v3.2.12.1 how can I apply styles and colours to my buttons? I can apply styles without colour. And I can apply colour without styles. But the two together makes a coloured without styles button. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> $guimain = GUICreate("test buttons") $btn = GUICtrlCreateButton("Testing button wrap", 10, 10, 75, 50, BitOr($BS_MULTILINE,$BS_CENTER,$BS_VCENTER)) GUICtrlSetBkColor($btn, 0x0066ff) ; <-- Comment out this line to see the difference GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn ExitLoop EndSwitch WEnd Exit Am I doing something wrong? Is this a bug? Is there a workaround? Thanks for your patience and help!
rasim Posted June 23, 2008 Posted June 23, 2008 You need to draw button, see GUIRegisterMsg() example in the help file.
Malkey Posted June 23, 2008 Posted June 23, 2008 Hi folks. Yet again I have a gui problem. Using v3.2.12.1 how can I apply styles and colours to my buttons? I can apply styles without colour. And I can apply colour without styles. But the two together makes a coloured without styles button. Am I doing something wrong? Is this a bug? Is there a workaround? Thanks for your patience and help! I thought of this. Not sure if it helps. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> $guimain = GUICreate("test buttons") ;$btn = GUICtrlCreateButton("Testing" & @CRLF& "button" & @CRLF& "wrap ", 10, 10, 75, 50, BitOr($BS_MULTILINE,$BS_CENTER,$BS_VCENTER)) $btn = GUICtrlCreateButton("Testing" & @CRLF& "button" & @CRLF& "wrap ", 10, 10, 75, 50, $BS_MULTILINE) ;$btn = GUICtrlCreateButton("Testing button wrap", 10, 10, 75, 50);, BitOr($BS_MULTILINE,$BS_CENTER,$BS_VCENTER)) GUICtrlSetBkColor($btn, 0x0066ff) ; <-- Comment out this line to see the difference GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn ExitLoop EndSwitch WEnd Exit
nikink Posted June 24, 2008 Author Posted June 24, 2008 Thanks Rasim, I will have a look at that. Why does it have to be done that way? *IS* it a bug? Thanks Malkey, your example is pretty reasonable, and may be ok for what I need, even if it's not perfect. Certainly seems easier!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now