Jump to content
Sign in to follow this  
cappy2112

Displaying a specific item in a Combo box

Recommended Posts

cappy2112

I've filled 2 combo boxes with 32 items, and now I want to display first item in one box, and the last item in the other box.

After filling the combos, nothing is displayed in either box.

Would someone point to to an example of how to do this, or at least the API's?

Share this post


Link to post
Share on other sites
Valuater

maybe this

#include <GUIConstants.au3>
#include <Date.au3>


GUICreate("MY GUI")

$Button_1 = GUICtrlCreateButton("Select", 10, 50, 50, 20)
$Button_2 = GUICtrlCreateButton("Exit", 60, 50, 50, 20)
$Label_4 = GUICtrlCreateLabel("", 10, 10, 400, 30)
GUICtrlSetFont($Label_4, 12)
$Combo1 = GUICtrlCreateCombo("", 56, 250, 161, 21)
GUICtrlSetData(-1, "_IEFormGetCount(|_IEFormGetCollection(|_IEFormGetObjByIndex(|_IEFormGetObjByName(|_IEFormGetNameByIndex(|_IEFormElementGetCount(|_IEFormElementGetCollection(|" & _
    "_IEFormElementGetObjByIndex(|_IEFormElementGetObjByName(|_IEFormElementGetTypeByIndex(|_IEFormElementOptionGetCount(|_IEFormElementGetValue(|_IEFormElementSetValue(|_IEFormSubmit(|_IEFormReset(")
$Combo2 = GUICtrlCreateCombo("", 56, 200, 161, 21)
GUICtrlSetData(-1, "www.google.com|www.spamit.com|www.xpclenmenu.hostrocket.com|www.autoit3.com")
GUISetState()

ControlSetText("MY GUI", "", $Combo1, "_IECreate(")
ControlSetText("MY GUI", "", $Combo2, "www.howdy.com")


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button_1
            GUICtrlSetData($Label_4, (GUICtrlRead($combo1)) & " " & (GUICtrlRead($combo2)) & " )")
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_2
            Exit
    EndSelect
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
cappy2112

Thanks for the reply

Something seems a littel strange here.

There's got to be a shorter way to dispaly a specific item in a combo box.

In VB I can do this in 2 lines of code.

Edited by cappy2112

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  

×