Jump to content

Recommended Posts

Posted

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.

Posted

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

  Reveal hidden contents
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!"

Posted

  On 1/6/2012 at 12:55 PM, 'GEOSoft said:

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")
  • Moderators
Posted

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:

  Reveal hidden contents

 

  • 5 weeks later...
Posted

  On 1/7/2012 at 8:10 PM, 'Melba23 said:

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?
  • Moderators
Posted

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:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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