Jump to content
Sign in to follow this  

[SOLVED] GuiCtrlCreateCombo

Recommended Posts

hello, i have a script where i add always data to a combo.

with lets say 50 datafields i can scroll and choose each data i want.

now i have 128 datafields and if i try to choose one, no matter if i try with mouse or arrow-keys, i cant choose. the combo close very fast without changing data.

is 128 combo-entries maybe too much?

Posted Image

Edited by andygo

Share this post

Link to post
Share on other sites

is 128 combo-entries maybe too much?

#include <GUIConstantsEx.au3>

GUICreate("My GUI combo", 300, 300) ; will create a dialog box that when displayed is centered
$idCombo = GUICtrlCreateCombo("<Select IPv4 Address>", 20, 20) ; create first item
For $n = 1 To 254
    GUICtrlSetData($idCombo, "192.168.0." & $n)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
        Case $idCombo
            If GUICtrlRead($idCombo) <> "<Select IPv4 Address>" Then MsgBox(64, "Selection", GUICtrlRead($idCombo))

The demo presents 255 items.

There is some limit, and I'm not sure what it is, but it would be more like 4K, 16K, or 32K items not just a couple hundred.

Edit: You could change the loop like this to get 64K items:

For $m = 0 To 255
    $sData = "192.168." & $m & ".0|"
    For $n = 1 To 255
        $sData &= "1921.68." & $m & "." & $n & "|"
    GUICtrlSetData($idCombo, $sData)

Now it takes like 20sec to populate on my laptop, and the list is awkward to scroll through. So you have to decide when it becomes too painful for the user - and you still haven't hit an upper limit.


Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

128 or 256 is certainly no where near the limit (I don't know exactly what it is) but I have used combo-box / Drop-down lists in AutoIt with over 1,000,000 items in it and had no problems selecting specific items. It did however take a couple of minutes to populate. So I would suggest that the problem lies elsewhere in your code.

If you could post the section of your code that populates and reads the combo, someone may be able to spot what is causing the problem.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post

Link to post
Share on other sites


thanks for the replies. meanwhile the problem isnt present anymore, whyever...

i think it was because of a wrong-defined variable for

a functioncall. mabye a special order of some steps caused it. i have to take a look at it.

regards, andy

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...