iDenoQ Posted August 15, 2011 Share Posted August 15, 2011 As my GUI grew I had to add tabs and that's where I encountered insurmountable problems with ComboBoxEx components. I have followed advices to use ControlHide and ControlShow but it produces strange effects on both WinXP and Win7, comboboxex controls disappear, or they are not repainted or they are not clickable etc. If I use WinSetState @SW_HIDE/@SW_SHOW instead of ControlHide/ControlShow everything works OK but it is very very slow to hide components as I switch tabs - totally unusable. I made small demo script based on my application to demonstrate effect. I might be making big mistake somewhere or skipped important information in help files? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiComboBoxEx.au3> $_Gui = GUICreate ( "dcc", 560, 520, -1, -1, -1, $WS_EX_LAYERED ) GUISetState(@SW_HIDE) $child_GUI = GUICreate("xxy", 560, 520, -1, -1, -1, -1, $_Gui) GUISetFont( 8.5, 300, -1, "Andale Mono" ) $childTab = GUICtrlCreateTab( 11, 11, 540, 500 ) $tab1 = GUICtrlCreateTabItem( " tab 1 " ) $chp = _GUICtrlComboBoxEx_Create( $child_GUI, "", 30, 50, 140, 150, 0x0003 ) $tab2 = GUICtrlCreateTabItem( " tab 2 " ) $crp = _GUICtrlComboBoxEx_Create( $child_GUI, "", 30, 50, 140, 150, 0x0003 ) $tab3 = GUICtrlCreateTabItem( " tab 3 " ) GUICtrlCreateLabel( "I am just a label", 50, 404 ) GUICtrlCreateTabItem("") GUISetState() _GUICtrlComboBoxEx_AddString( $chp, "AA1" ) _GUICtrlComboBoxEx_AddString( $chp, "AA2" ) _GUICtrlComboBoxEx_AddString( $chp, "AA3" ) _GUICtrlComboBoxEx_AddString( $chp, "AA4" ) _GUICtrlComboBoxEx_SetCurSel( $chp, 0 ) _GUICtrlComboBoxEx_AddString( $crp, "BB1" ) _GUICtrlComboBoxEx_AddString( $crp, "BB2" ) _GUICtrlComboBoxEx_AddString( $crp, "BB3" ) _GUICtrlComboBoxEx_SetCurSel( $crp, 0 ) ControlHide( $crp, "", "" ) While 1 $msg = GUIGetMsg() Switch( $msg ) Case $GUI_EVENT_CLOSE Exit Case $childTab If GUICtrlRead( $childTab, 1 ) = $tab1 Then ControlHide( $crp, "", "" ) ControlShow( $chp, "", "" ) ElseIf GUICtrlRead( $childTab, 1 ) = $tab2 Then ControlHide( $chp, "", "" ) ControlShow( $crp, "", "" ) Else ControlHide( $crp, "", "" ) ControlHide( $crp, "", "" ) EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 15, 2011 Moderators Share Posted August 15, 2011 iDenoQ,Obvious question: Why use the GUICtrlComboBoxEx UDF? What does it give you that the more usual Combo creation functions do not? 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...
iDenoQ Posted August 15, 2011 Author Share Posted August 15, 2011 To be honest, reason is half-stupid - I got carried, started using Ex combobox thinking of using it's editing capabilities and abandoned that idea along the way (10 days of programming) - so I made style 0x0003 - and left it so I may use that feature again. I will definitely change everything back to normal combobox since I tested and it works with tabs quite nicely. Thanks for help! Link to comment Share on other sites More sharing options...
iDenoQ Posted August 15, 2011 Author Share Posted August 15, 2011 (edited) Oh well I remembered now - it was _GUICtrlComboBoxEx_GetItemText() that I used to use in comboboxex I didn't know that I could use _GUICtrlComboBoxEx_GetItemText() on ComboBox created with _GUICtrlComboBox_Create. Now I know... Edited August 15, 2011 by iDenoQ 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