TheCurrent Posted April 18, 2011 Share Posted April 18, 2011 am trying to stack pictureboxs each contaning its own set of some other controls, but its not working in koda. the controls seems to go behind the picturebox, so i used the $WS_CLIPSIBLINGS style the man reason am using a pictureboxs is that i have stacked 10 pictureboxes ontop of each other, and need each to hold its controls, i would hide all unnecessary picturebox at runtime and display only the one needed. the effect is that hiding a picturebox, automatically hide its controls. i would have used a tab control, but it would take some extra space and defeat the purpose of hiding the other controls i the picturebox, showing them only when necessary, not switching. Does anyone know how to do this? is there any other control that can do this? can the picturebox host controls? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 18, 2011 Moderators Share Posted April 18, 2011 TheCurrent,I am still confused by what you are trying to do. Let me see if I have it straight: You want to have 10 different "screens" on your GUI. At present you are trying to use 10 Pic controls to hold the controls in each "screen" and hiding/showing the Pic controls to make only the current "screen" visible. Is that close? If so, why are using Pic controls? Why not just hide/show the other controls directly? I would do it like this: expandcollapse popup#include <GUIConstantsEx.au3> ; Create arrays to hold the controls for each screen Global $aScreen_1[2] Global $aScreen_2[2] $hGUI = GUICreate("Test", 500, 500) ; Screen 1 $hLabel_1 = GUICtrlCreateLabel("Label 1", 10, 10, 200, 20) $aScreen_1[0] = $hLabel_1 $hButton_1 = GUICtrlCreateButton("Button 1", 100, 100, 80, 30) $aScreen_1[1] = $hButton_1 ; Screen 2 $hLabel_2 = GUICtrlCreateLabel("Label 2", 10, 40, 200, 20) $aScreen_2[0] = $hLabel_2 $hButton_2 = GUICtrlCreateButton("Button 2", 100, 140, 80, 30) $aScreen_2[1] = $hButton_2 _Swap_Screen(1) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton_1 _Swap_Screen(1) Case $hButton_2 _Swap_Screen(2) EndSwitch WEnd Func _Swap_Screen($iIndex) Switch $iIndex Case 1 ; Hide Screen 1 For $i = 0 To 1 GUICtrlSetState($aScreen_1[$i], $GUI_HIDE) Next ; Show Screen 2 For $i = 0 To 1 GUICtrlSetState($aScreen_2[$i], $GUI_SHOW) Next Case 2 ; Hide Screen 2 For $i = 0 To 1 GUICtrlSetState($aScreen_2[$i], $GUI_HIDE) Next ; Show Screen 1 For $i = 0 To 1 GUICtrlSetState($aScreen_1[$i], $GUI_SHOW) Next EndSwitch EndFuncThe _Swap_Screen function is pretty rough, but it gives you the idea. 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, but this implementation would be a very long coding for me.i use spy++ to check the styles of a regulat picturebox, it has WS_CLIPCHILDREN style along with the WS_CLIPSIBLINGS, and i found this in the documentation Adding $WS_CLIPCHILDREN style can avoid some flickering when resizing GUI containing Edit control for example.Koda does not list this style as style that can be added to picturebox control Link to comment Share on other sites More sharing options...
Skitty Posted April 18, 2011 Share Posted April 18, 2011 thanks, but this implementation would be a very long coding for me.i use spy++ to check the styles of a regulat picturebox, it has WS_CLIPCHILDREN style along with the WS_CLIPSIBLINGS, and i found this in the documentation Koda does not list this style as style that can be added to picturebox controlWell, Koda doesnt exactly do everything fore you...You need to manually adjust those settings as koda only helps you create a basic skeleton of what you need done. 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