Jump to content

ComboBox Max List Items?


 Share

Recommended Posts

I've googled everything I could and cant find my answer so I am posting, Is there a limit to the amount of items that can go in the ComboBox? I only can get 29 and nothing shows after that. And is there a way to make it a scrolling combobox?

Note: I am using Koda to create my gui, if I am approching this the wrong way I apologize. I am new to all of this.

Thanks.

Link to comment
Share on other sites

What styles did you use for your combo? I can tell you for sure that a combo will hold a lot more than 29 items and it should have the scroll by default unless you messed that up with styles.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

What styles did you use for your combo? I can tell you for sure that a combo will hold a lot more than 29 items and it should have the scroll by default unless you messed that up with styles.

Yeah I did gum up the styles thanks for pointing me in the right direction. It is much appreciated. Any way to shorten how far down the comboBox drops? It seems to go the length of the form. Even though it scrolls; it only scrolls 2 items.

$cmbBranch = GUICtrlCreateCombo("Please Select Your Branch", 170, 40, 160, 25, $GUI_SS_DEFAULT_COMBO)
GUICtrlSetData(-1, "000 - St. Louis/HQ|002 - East Peoria|003 - Sikeston|004 - Decatur|005 - Columbia|006 - LaSalle|008 - Mt. Vernon|009 - Hannibal|011 - CAT/East Peoria|012 - CAT/Mossville|014 - CAT/Joliet|016 - CAT/Aurora|017 - CAT/Decatur|031 - Memphis|033 - Tupelo|034 - Jackson|035 - Jonesboro|037 - Little Rock|038 - Springdale|039 - Ft. Smith|040 - Kansas City|041 - Springfield|042 - Joplin|043 - Wichita|044 - St. Joseph|060 - Indianapolis|061 - Ft. Wayne|062 - Lafayette|063 - Muncie|065 - Terre Haute|069 - Columbus|Feitek|Global")
Link to comment
Share on other sites

  • Moderators

carlosrapa,

Here you go - a bit of an improvement: ;)

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>

$hGUI = GUICreate("Test", 500, 500)

; Create combo empty
$cmbBranch = GUICtrlCreateCombo("", 170, 40, 160, 25)
; Now add data
GUICtrlSetData(-1, "000 - St. Louis/HQ|002 - East Peoria|003 - Sikeston|004 - Decatur|005 - Columbia|006 - LaSalle|008 - Mt. Vernon|009 - Hannibal|011 - CAT/East Peoria|012 - CAT/Mossville|014 - CAT/Joliet|016 - CAT/Aurora|017 - CAT/Decatur|031 - Memphis|033 - Tupelo|034 - Jackson|035 - Jonesboro|037 - Little Rock|038 - Springdale|039 - Ft. Smith|040 - Kansas City|041 - Springfield|042 - Joplin|043 - Wichita|044 - St. Joseph|060 - Indianapolis|061 - Ft. Wayne|062 - Lafayette|063 - Muncie|065 - Terre Haute|069 - Columbus|Feitek|Global")
; Now set the edit text - this way it is not one of the possible selections
_GUICtrlComboBox_SetEditText($cmbBranch, "Please Select Your Branch")
; And now limit the number of items to show to 15
GUICtrlSendMsg($cmbBranch, $CB_SETMINVISIBLE, 15, 0)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Note that $CB_SETMINVISIBLE actually sets the MAX visible - blame Bill Gates, not me! :D

Please ask if you have any questions. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 5 weeks later...

carlosrapa,

Here you go - a bit of an improvement: ;)

#include <GUIConstantsEx.au3>
#include <GUIComboBox.au3>

$hGUI = GUICreate("Test", 500, 500)

; Create combo empty
$cmbBranch = GUICtrlCreateCombo("", 170, 40, 160, 25)
; Now add data
GUICtrlSetData(-1, "000 - St. Louis/HQ|002 - East Peoria|003 - Sikeston|004 - Decatur|005 - Columbia|006 - LaSalle|008 - Mt. Vernon|009 - Hannibal|011 - CAT/East Peoria|012 - CAT/Mossville|014 - CAT/Joliet|016 - CAT/Aurora|017 - CAT/Decatur|031 - Memphis|033 - Tupelo|034 - Jackson|035 - Jonesboro|037 - Little Rock|038 - Springdale|039 - Ft. Smith|040 - Kansas City|041 - Springfield|042 - Joplin|043 - Wichita|044 - St. Joseph|060 - Indianapolis|061 - Ft. Wayne|062 - Lafayette|063 - Muncie|065 - Terre Haute|069 - Columbus|Feitek|Global")
; Now set the edit text - this way it is not one of the possible selections
_GUICtrlComboBox_SetEditText($cmbBranch, "Please Select Your Branch")
; And now limit the number of items to show to 15
GUICtrlSendMsg($cmbBranch, $CB_SETMINVISIBLE, 15, 0)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Note that $CB_SETMINVISIBLE actually sets the MAX visible - blame Bill Gates, not me! ;)

Please ask if you have any questions. :)

M23

Thanks for your help it is very much appreciated. Any way to mark this as solved?
Link to comment
Share on other sites

  • Moderators

carlosrapa,

Yes, edit the first post and select the "Use full editor" option - that opens up the title for editing as well. :)

And please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unneccarily. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...