Sign in to follow this  
Followers 0
zac23

Combo box

2 posts in this topic

#1 ·  Posted (edited)

Im trying to list the user profiles in a drop down box,

is there a better way to do this than listing a heap of GUICtrlSetData,

like can i make it

GUICtrlCreateCombo("item1", 10, 10)

GUICtrlSetData(-1, $users )

;where $users is '$users=_FileListToArray("D:\USERS")'

i know there has got to be an easy way to do this, i searched the fourums and help file to no avail

thanks for any help,

Zac

Edited by zac23

Share this post


Link to post
Share on other sites



All you need to is use _ArrayToString():

#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <Array.au3>

Global $arrCOMBO[10]
$arrCOMBO[0]="abc"
$arrCOMBO[1]="xyz"
$arrCOMBO[2]="123"
$arrCOMBO[3]="321"
$arrCOMBO[4]="666"
$arrCOMBO[5]="999"
$arrCOMBO[6]="hello"
$arrCOMBO[7]="goodbye"
$arrCOMBO[8]="who"
$arrCOMBO[9]="what"

$arrSTRING=_ArrayToString($arrCOMBO)

$FRM1 = GUICreate("", 202, 59, 192, 124)
$COMBO = GUICtrlCreateCombo("", 24, 16, 145, 25)
GUICtrlSetData(-1,$arrSTRING)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Good luck!


Instant Lockerz Invite - www.instantlockerzinvite.co.uk

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  
Followers 0