laffo16 Posted April 28, 2009 Share Posted April 28, 2009 hey guys, i'm aware this is a really old question as ive been just spent alot of time trying to find an answer. typically, my problem & question is: is it possible to place a button ontop of a label. without making the label transparent (with clipsiblings). ive tried, different tab orders, different styles, rooted around the forum but the only time this problem has been talked about in the past is when it has been a genuine mistake, where as i actually want to place my button on top of a label. is this possible? depending on tab order, i get either a temporary invisable (until hovered) but then clickable button, or a visable but unclickable button. have tried all the guictrlsetstates i thought might work but no go. pretty much given up, am i missing something? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 28, 2009 Moderators Share Posted April 28, 2009 laffo16, Disable the label - then AutoIt does not get confused about which control is active at that point on the GUI:#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel("", 10, 10, 100, 50) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetState(-1, $GUI_DISABLE) $hButton = GUICtrlCreateButton("Press", 20, 20, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton MsgBox(0,"Hit", "You pressed it") EndSwitch WEnd M23 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...
laffo16 Posted April 28, 2009 Author Share Posted April 28, 2009 (edited) thanks for your help melba23 and the example, however, could you take a look at this, i'm now want the $walker label to fall behind $static and $button when it reaches them. #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $walker = GUICtrlCreateLabel("test", 10, 250, 120, 20) GUICtrlSetBkColor(-1, 0xDDCCBB) $static = GUICtrlCreateLabel("", 10, 10, 100, 200) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetState(-1, $GUI_DISABLE) $hButton = GUICtrlCreateButton("Press", 20, 20, 80, 30) GUISetState() $switch = 1 $y = 250 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton MsgBox(0,"Hit", "You pressed it") EndSwitch If $switch = 1 Then $y += -1 ElseIf $switch = 2 Then $y += 1 EndIf ControlMove("Test", "", $walker, 10, $y) Sleep(30) WEnd does controlmove have some sort of always set on top property? edit: it seems that is the case. so i tried GUICtrlSetPos (which does fall below $static) but not having much luck fixing the flickering problem. anyone know which gui/ctrl states i should invoke? Edited April 28, 2009 by laffo16 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 28, 2009 Moderators Share Posted April 28, 2009 laffo16,Just use a CLIPSIBLINGS style for $walker:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 500) $static = GUICtrlCreateLabel("", 10, 10, 100, 200) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetState(-1, $GUI_DISABLE) $hButton = GUICtrlCreateButton("Press", 20, 20, 80, 30) $walker = GUICtrlCreateLabel("test", 10, 250, 120, 20, $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0xDDCCBB) GUISetState() $switch = 1 $y = 250 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton MsgBox(0,"Hit", "You pressed it") EndSwitch If $switch = 1 Then $y += -1 ElseIf $switch = 2 Then $y += 1 EndIf ControlMove("Test", "", $walker, 10, $y) Sleep(30) WEndM23 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...
laffo16 Posted April 28, 2009 Author Share Posted April 28, 2009 dah, u make it look to easy ^^ thanks again bud 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