jinyue115 Posted September 4, 2010 Posted September 4, 2010 #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered GUICtrlCreateCombo("item1", 10, 10) ; create first item GUICtrlSetData(-1, "item2|item3", "item3") ; add other item snd set a new default GUISetState() ; Run the GUI until the dialog is closed While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $label0;x Exit Case item2 ;Start item2();here is i want to do -->once select combo data item2 , then perfrom call item2 function -->Till now have not fixed this issue , i have tried with ID and call function , but still not work , pls give me a hand , thank you . EndSwitch WEnd EndFunc ;==>Example Func item2() MsgBox(0,1,1) EndFunc
Moderators Melba23 Posted September 4, 2010 Moderators Posted September 4, 2010 jinyue115,I have just posted some code in this thread which shows how to do action combo selections. M23P.S. When you post code please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). Or press the blue button just under the BOLD toolbar button. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
wakillon Posted September 4, 2010 Posted September 4, 2010 Add a button for select your choice #include <GUIConstantsEx.au3> Local $nmsg GUICreate("My GUI combo") ; will create a dialog box that when displayed is centered $Button1 = GUICtrlCreateButton ( "Apply selection", 8, 56, 100, 25 ) $_Combo = GUICtrlCreateCombo("item1", 10, 10) ; create first item GUICtrlSetData(-1, "item2|item3", "item3") ; add other item snd set a new default GUISetState() ; Run the GUI until the dialog is closed While 1 $nMsg = GUIGetMsg() Switch $nMsg ;Case $label0;x ; Exit Case $Button1 $menustate = GUICtrlRead ( $_Combo, 1 ) If $menustate ='item2' Then ConsoleWrite ( '$menustate : ' & $menustate & @Crlf ) item2() EndIf EndSwitch WEnd Func item2() MsgBox ( 0, 1, $menustate ) EndFunc AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
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