TheCurrent Posted April 18, 2011 Share Posted April 18, 2011 I'd like to use the picturebox control to host some other controls, but its not working in koda. the controls seems to go behind the picturebox. I decided to use the picturebox because the frame control does not properly suite my application. Does anyone know how to do this? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2011 Moderators Share Posted April 18, 2011 TheCurrent,I wish I had £1 for every time this has been asked since I have been here! From the very useful and sorely under-read Help file (look at the Remarks on the GUICtrlCreatePic page): "If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls"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...
TheCurrent Posted April 18, 2011 Author Share Posted April 18, 2011 thanks for your answer,i read the documentation, but because my gui is albeit complex, i am using Koda and included the $WS_CLIPSIBLINGS to make the hosted controls from going behind, but it still does not move them together when the picturebox is moved the man reason am using a picturebox is that i have stacked 10 picture boxes ontop of each other, and need each to hold its control. i would have used a tab control, but it would take some extra space and defiet the purpose of hiding the other controls i the picturebox, showing them only when necessary is there any other control that can do this? Link to comment Share on other sites More sharing options...
Skitty Posted April 18, 2011 Share Posted April 18, 2011 TheCurrent,I wish I had £1 for every time this has been asked since I have been here! From the very useful and sorely under-read Help file (look at the Remarks on the GUICtrlCreatePic page): "If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls"M23LoL, this just solved a little problem I've been having for a while now. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2011 Moderators Share Posted April 18, 2011 TheCurrent,It is always a good idea to explain the problem completely when you post a question - then you do not get unhelpful replies and the responder does not waste their (perhaps valuable) time. Stacking Pic controls is fraught with diffculty as you have discovered. Why not post your code (at least the GUI part) so that we can take a look. And please explain carefully what is not happening as you wish it to because I am very confused by the content of your last post. 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...
Skitty Posted April 18, 2011 Share Posted April 18, 2011 thanks for your answer,i read the documentation, but because my gui is albeit complex, i am using Koda and included the $WS_CLIPSIBLINGS to make the hosted controls from going behind, but it still does not move them together when the picturebox is movedthe man reason am using a picturebox is that i have stacked 10 picture boxes ontop of each other, and need each to hold its control.i would have used a tab control, but it would take some extra space and defiet the purpose of hiding the other controls i the picturebox, showing them only when necessaryis there any other control that can do this?Lol, why dont you just set the controls state to "$GUI_HIDE" instead of doing what you said?Edit: is there a way to reduce flickering?Like when a user clicks on a button, is there a way to make the gui look like its not having a seizure? Link to comment Share on other sites More sharing options...
TheCurrent Posted April 18, 2011 Author Share Posted April 18, 2011 Thanks for responding, i have posted in the GUI forum, here is the link Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2011 Moderators Share Posted April 18, 2011 System238, is there a way to reduce flickering?This is usually caused by updating the control each pass through the idle loop. The trick is to only change the control when it is needed by checking to see what state it is in - like this: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $hLabel_1 = GUICtrlCreateLabel("I will flicker", 10, 10, 200, 20) $hLabel_2 = GUICtrlCreateLabel("I will not flicker", 10, 40, 200, 20) $hButton = GUICtrlCreateButton("Update", 10, 100, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton GUICtrlSetData($hLabel_2, "Change so the loop will update the text") EndSwitch GUICtrlSetData($hLabel_1, "I will flicker") If GUICtrlRead($hLabel_2) <> "I will not flicker" Then GUICtrlSetData($hLabel_2, "I will not flicker") EndIf WEnd TheCurrent, Why start a new thread? But I will go and take a look. 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...
TheCurrent Posted April 18, 2011 Author Share Posted April 18, 2011 MB, sorry for that, i thought i get better response over there, and i misunderstood you Why not post your code (at least the GUI part) so that we can take a look. Here is a basic setup #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form1", 511, 339, 225, 150) $Pic1 = GUICtrlCreatePic("", 195, 55, 271, 201, BitOR($GUI_SS_DEFAULT_PIC,$WS_CLIPSIBLINGS)) GUICtrlSetOnEvent(-1, "Pic1Click") $Pic2 = GUICtrlCreatePic("", 10, 50, 251, 191, BitOR($GUI_SS_DEFAULT_PIC,$WS_CLIPSIBLINGS)) GUICtrlSetOnEvent(-1, "Pic2Click") $Input1 = GUICtrlCreateInput("Input1", 95, 70, 121, 21) GUICtrlSetOnEvent(-1, "Input1Change") $Input2 = GUICtrlCreateInput("Input2", 325, 120, 126, 21) GUICtrlSetOnEvent(-1, "Input2Change") $Button1 = GUICtrlCreateButton("Button1", 170, 210, 81, 21) GUICtrlSetOnEvent(-1, "Button1Click") $Button2 = GUICtrlCreateButton("Button2", 380, 220, 76, 21) GUICtrlSetOnEvent(-1, "Button2Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Link to comment Share on other sites More sharing options...
TheCurrent Posted April 18, 2011 Author Share Posted April 18, 2011 MB, sorry for that, i thought i get better response over there, and i misunderstood you Why not post your code (at least the GUI part) so that we can take a look. Here is a basic setup #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form1", 511, 339, 225, 150) $Pic1 = GUICtrlCreatePic("", 195, 55, 271, 201, BitOR($GUI_SS_DEFAULT_PIC,$WS_CLIPSIBLINGS)) GUICtrlSetOnEvent(-1, "Pic1Click") $Pic2 = GUICtrlCreatePic("", 10, 50, 251, 191, BitOR($GUI_SS_DEFAULT_PIC,$WS_CLIPSIBLINGS)) GUICtrlSetOnEvent(-1, "Pic2Click") $Input1 = GUICtrlCreateInput("Input1", 95, 70, 121, 21) GUICtrlSetOnEvent(-1, "Input1Change") $Input2 = GUICtrlCreateInput("Input2", 325, 120, 126, 21) GUICtrlSetOnEvent(-1, "Input2Change") $Button1 = GUICtrlCreateButton("Button1", 170, 210, 81, 21) GUICtrlSetOnEvent(-1, "Button1Click") $Button2 = GUICtrlCreateButton("Button2", 380, 220, 76, 21) GUICtrlSetOnEvent(-1, "Button2Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd remember that am using koda Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2011 Moderators Share Posted April 18, 2011 TheCurrent, Go and look in the other thread. 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...
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