Lope Posted April 20, 2011 Share Posted April 20, 2011 (edited) How do you get GUIGetMsg() for a button ontop of a label? If I create the button after the label it displays the button ontop of the label as you'd expect. Problem is I can't click it unless I disable the label. But if I disable the label, the label text goes grey. (setting the color doesn't work. Any ideas? Example #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 454, 192, 114) $Label1 = GUICtrlCreateLabel("The dog (Canis lupus familiaris[3] and Canis lupus dingo[1][2]) is a domesticated form of the gray wolf, a member of the Canidae family of the order Carnivora. The term is used for both feral and pet varieties. The dog was the first animal to be domesticated, and has been the most widely kept working, hunting, and companion animal in human history. The word 'dog' may also mean the male of a canine species,[4] as opposed to the word 'bitch' for the female of the species.", 104, 216, 464, 153) $Button1 = GUICtrlCreateButton("Button1", 288, 224, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 msgbox(0,"","clicked") EndSwitch WEnd Edited April 20, 2011 by Lope Link to comment Share on other sites More sharing options...
November Posted April 20, 2011 Share Posted April 20, 2011 How do you get GUIGetMsg() for a button ontop of a label? If I create the button after the label it displays the button ontop of the label as you'd expect. Problem is I can't click it unless I disable the label. But if I disable the label, the label text goes grey. (setting the color doesn't work. Any ideas? Example #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 454, 192, 114) $Label1 = GUICtrlCreateLabel("The dog (Canis lupus familiaris[3] and Canis lupus dingo[1][2]) is a domesticated form of the gray wolf, a member of the Canidae family of the order Carnivora. The term is used for both feral and pet varieties. The dog was the first animal to be domesticated, and has been the most widely kept working, hunting, and companion animal in human history. The word 'dog' may also mean the male of a canine species,[4] as opposed to the word 'bitch' for the female of the species.", 104, 216, 464, 153) $Button1 = GUICtrlCreateButton("Button1", 288, 224, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 msgbox(0,"","clicked") EndSwitch WEnd Hi, GUICtrlSetState($Button1, $gui_ontop) cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 20, 2011 Moderators Share Posted April 20, 2011 (edited) Lope,Or you can remove the forced $SS_NOTIFY style from the label so that it no longer is a clickable control - it the overlapping active controls that confuse AutoIt. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $Form1 = GUICreate("Form1", 633, 454, 192, 114) $Label1 = GUICtrlCreateLabel("The dog (Canis lupus familiaris[3] and Canis lupus dingo[1][2]) is a domesticated form of the gray wolf, a member of the Canidae family of the order Carnivora. The term is used for both feral and pet varieties. The dog was the first animal to be domesticated, and has been the most widely kept working, hunting, and companion animal in human history. The word 'dog' may also mean the male of a canine species,[4] as opposed to the word 'bitch' for the female of the species.", 104, 216, 464, 153) GUICtrlSetStyle(-1, $SS_LEFT) $Button1 = GUICtrlCreateButton("Button1", 288, 224, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 msgbox(0,"","clicked") EndSwitch WEndBy explicitly setting the $SS_LEFT style we overwrite the default setting of $SS_LEFT and $SS_NOTIFY styles - read the Setting Styles tutorial in the Wiki for about this. M23Edit: Added explanation. Edited April 20, 2011 by Melba23 argumentum and Fr33b0w 1 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Lope Posted April 20, 2011 Author Share Posted April 20, 2011 YOU GUYS ARE THE ULTIMATE!!!!!!!+KARMA!November: I was simplifying when I gave the example with the button. My actual implementation It probably should have been one thread. I just wanted to keep the question simple and to the point.Thanks!! 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