Sign in to follow this  
Followers 0
firman

How to pull data from combo box?

2 posts in this topic

Here is my code:

GuiCtrlCreateGroup("Office Version", 92, 40, 135, 40)
GUICtrlCreateCombo ("No Office Installed",100, 53, 120, 10) ; create first item
$office_version = GUICtrlSetData(-1,"Office XP|Office 2000|Office 2003","No Office Installed") ; add other item snd set a new default

Now.. How do I pull the data of which one is selected from this box?

Also, I want to have a text box below this that I put the office key in, but I want it grayed out until something other that No Office Installed is selected... How can I do that as well??

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

to read the combo:

#include <GuiConstants.au3>

$gui = GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
GuiCtrlCreateGroup("Office Version", 92, 40, 135, 40)
$office_version =GUICtrlCreateCombo ("No Office Installed",100, 53, 120, 10) ; create first item
GUICtrlSetData(-1,"Office XP|Office 2000|Office 2003","No Office Installed") ; add other item snd set a new default
GuiSetState()

do  
    $msg = GuiGetMsg()
    $read = GUICtrlRead($office_version)
Until  $msg = $GUI_EVENT_CLOSE

$read returns the selcted combo with full name such as "No Office Instaled"

Notis that i moved $office_version to Guictrlcreatecombo.

Edited by Alek

[font="Impact"]Never fear, I is here.[/font]

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