Archman Posted July 20, 2008 Share Posted July 20, 2008 (edited) I want to create a combo box with 4 options. I can make it return the text for each option but how do i make it return the number of the option selected? $n1 = GUICtrlCreateCombo("", 10, 88, 300, 25) GUICtrlSetData(-1, "Do this|Do that|Do something Else", "Do this") So if "Do this" is selected i want it to return 1 "Do that" returns 2 "Do something else" returns 3 so that i can have something like if GUICtrlRead($n1) = 1 Then Code I want EndIf Doh! if GUICtrlRead($n1) = "Do this" Then Code I want EndIf Edited July 20, 2008 by Archman Link to comment Share on other sites More sharing options...
d3mon Posted July 20, 2008 Share Posted July 20, 2008 I want to create a combo box with 4 options. I can make it return the text for each option but how do i make it return the number of the option selected? $n1 = GUICtrlCreateCombo("", 10, 88, 300, 25) GUICtrlSetData(-1, "Do this|Do that|Do something Else", "Do this") So if "Do this" is selected i want it to return 1 "Do that" returns 2 "Do something else" returns 3 so that i can have something like if GUICtrlRead($n1) = 1 Then Code I want EndIf Doh! if GUICtrlRead($n1) = "Do this" Then Code I want EndIf Do you know read autoit help ? or you won't do any effort ? GUICreate("",500,500) $n1 = GUICtrlCreateCombo("", 10, 10, 300, 25) GUICtrlSetData(-1, "Do this|Do that|Do something Else", "Do this") GUISetState() While 1 If GUICtrlRead($n1)="Do this" Then ;Your code EndIf If GUICtrlRead($n1)="Do that" Then ;Your code EndIf If GUICtrlRead($n1)="Do something Else" Then ;Your code EndIf WEnd No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now