Floppy Posted March 4, 2009 Share Posted March 4, 2009 Hello, I have a problem. I'm creating a GUI with a combo. In the combo there are 60 items, but the combo shows only the first 30. What's the problem? Link to comment Share on other sites More sharing options...
DaRam Posted March 4, 2009 Share Posted March 4, 2009 The problem is no code What's the problem? Link to comment Share on other sites More sharing options...
cherdeg Posted March 4, 2009 Share Posted March 4, 2009 (edited) If that won't click within your head, probably nothing will:#include <GuiConstantsEx.au3> Opt("GuiOnEventMode", 1) $hGUI = GUICreate("Test", 300, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") Local $a_ConnectionList[3] = ["Intel Copper Ethernet", "BroadCom Fibre", "VMware Network Adapter"] $ge_Label_Connection = GUICtrlCreateLabel("Please select the NIC to use:", 16, 10, 200, 17) $ge_Combo_Connection = GUICtrlCreateCombo($a_ConnectionList, 16, 30, 249, 300, 0x0003) For $i = 0 To UBound($a_ConnectionList) - 1 GUICtrlSetData($ge_Combo_Connection, $a_ConnectionList[$i], $a_ConnectionList[0]) Next GUISetState() While 1 Sleep(10) Wend Func _Quit() Exit EndFuncThe key to your wish is 0x0003. Next time 1st RTFM (helpfile, you may reach it by pressing F1 in SciTe) and 2nd post your code or nobody will help you.Regards,ChrisEDIT: BTW, above I yesterday wrote complete bullshit probably having my head somewhere else. The option "0x0003" is meant to make the values displayed by the combo read-only. But at the same time the option seems to limit the combo to 30 items max. So also for me the question arises how to force showing all items? Edited March 5, 2009 by cherdeg Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 4, 2009 Moderators Share Posted March 4, 2009 FSoft,If I populate a combobox with 60 items, I get the first 30 displayed and a vertical scroll bar to move down to the next 30:Global $sString = "" For $i = 1 To 60 $sString &= $i & "|" Next $hGUI = GUICreate("Test", 300, 100) $hCombo = GUICtrlCreateCombo("", 16, 30, 249, 300) GUICtrlSetData($hCombo, $sString) GUISetState() While 1 If GUIGetMsg() = -3 Then Exit WEndAre you saying that you do not get a scroll bar? Are you sure you have all 60 items in the GUICtrlSetData?As everyone else has asked - please post your code because lacking that vital element it is very difficult to do anything at all to help you. :-)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...
Floppy Posted March 5, 2009 Author Share Posted March 5, 2009 I didn't post the code because it is a simple GUI with 1 combo. I discovered that the problem is the $CBS_DROPDOWNLIST style. If I use that style, i see only the first 30 lines; if i don't use it i see all items with the scrollbar. Link to comment Share on other sites More sharing options...
Monamo Posted March 5, 2009 Share Posted March 5, 2009 I didn't post the code because it is a simple GUI with 1 combo. I discovered that the problem is the $CBS_DROPDOWNLIST style. If I use that style, i see only the first 30 lines; if i don't use it i see all items with the scrollbar.Change your style entry to: BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL) - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 5, 2009 Moderators Share Posted March 5, 2009 FSoft,The problem is not "the $CBS_DROPDOWNLIST style". The problem is you overwriting the default styles.If you read the Help file you see that the default style settings are: "$CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL". So if you set only $CBS_DROPDOWNLIST , you lose the 2 SCROLL styles.As Monamo has pointed out, you need to reset the $WS_VSCROLL style together with $CBS_DROPDOWNLIST to regain your scrollbar.This is true for all AutoIt controls - if you set any styles you must also reset any default styles that you need and have overwritten. As Valik is fond of saying (among other things!): "AutoIt cannot read your mind - you need to tell it what to do!"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...
trancexx Posted March 5, 2009 Share Posted March 5, 2009 I bet you didn't know Valik is a women. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Floppy Posted March 6, 2009 Author Share Posted March 6, 2009 FSoft,The problem is not "the $CBS_DROPDOWNLIST style". The problem is you overwriting the default styles.If you read the Help file you see that the default style settings are: "$CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL". So if you set only $CBS_DROPDOWNLIST , you lose the 2 SCROLL styles.As Monamo has pointed out, you need to reset the $WS_VSCROLL style together with $CBS_DROPDOWNLIST to regain your scrollbar.This is true for all AutoIt controls - if you set any styles you must also reset any default styles that you need and have overwritten. As Valik is fond of saying (among other things!): "AutoIt cannot read your mind - you need to tell it what to do!"M23Thanks, it works...P.S.: But who is Valik? 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