oldtimer Posted July 18, 2011 Share Posted July 18, 2011 I have created a simple GUI form. On the form, I want a button setting on top of a label. (for appearance, with colored background). I find that if I create the label first, then the button, the button shows up but won't "press". If I create the button first, then the label, the label is hidden. I tried setting the TOPMOST style but couldn't make that work. Is there a "simple" way to create the button on top of the label and still have it function properly? Thanks in advance for any suggestions. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 18, 2011 Share Posted July 18, 2011 Hi and Welcome to the forums!! Try disabling the label so it don't get the clicks instead of the button #include <GUIConstantsEx.au3> GUICreate(@ScriptName, 320, 240) GUICtrlCreateLabel("", 0, 0, 320, 240) GUICtrlSetBkColor(-1, 0xFFC0CB) GUICtrlSetState(-1, $GUI_DISABLE) $hButton = GUICtrlCreateButton("Press me", 50, 50, 75, 25) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton MsgBox(0, "Button pressed!", "Button pressed!") EndSwitch WEnd .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
oldtimer Posted July 18, 2011 Author Share Posted July 18, 2011 That was it! I guess I should have figured that out for myself but couldn't. Thank you very much. Link to comment Share on other sites More sharing options...
Valuater Posted July 18, 2011 Share Posted July 18, 2011 For Buttons, you might want to take a look at ButtonHover() Then, color the background with Skins.... Enjoy!! 8) Link to comment Share on other sites More sharing options...
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