Arnol5 Posted December 24, 2013 Share Posted December 24, 2013 Hello When i press the button i want it to read witch language i selected but it gives me an error that it doesn't understand Dutch,French,English,German So what does the GUICtrlRead give as outpout ? $Combo1 = GUICtrlCreateCombo("Server language", 32, 8, 113, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Dutch|French|English|German") Func button1() $var = GUICtrlRead($combo1) if $var = Dutch Then MsgBox(0,"blub","hell yeah") EndIf EndFunc thx in advance Link to comment Share on other sites More sharing options...
l3ill Posted December 24, 2013 Share Posted December 24, 2013 (edited) Hi Arnol5 I wouldn't use a Function for this. Use Select Case. Actually just use the example in the help file and change it a little for your purpose. Bill Edit: to answer your question- GUICtrlRead will read the control you feed it. But you are not calling your function anywhere. Edited December 24, 2013 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Solution jdelaney Posted December 24, 2013 Solution Share Posted December 24, 2013 (edited) ; assuming you are calling the function correctly: if $var = "Dutch" Then If not, provide the entire script. Edited December 24, 2013 by jdelaney Arnol5 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
UEZ Posted December 24, 2013 Share Posted December 24, 2013 #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Global Const $hGUI = GUICreate("Test", 300, 200) Global Const $iCombo1 = GUICtrlCreateCombo("Server language", 10, 8, 113, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Dutch|French|English|German") Global Const $iBtn = GUICtrlCreateButton("Check" & @CRLF & "Combo", 10, 50, 50, 50, $BS_MULTILINE) GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() Exit Case $iBtn (GUICtrlRead($iCombo1) = "Dutch") ? MsgBox(0,"blub","hell yeah") : "" EndSwitch Until False Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
kylomas Posted December 24, 2013 Share Posted December 24, 2013 Arnol5, In case you are not aware of this. When you click on an entry in a listbox (combobox) the control is actioned so... #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #AutoIt3Wrapper_Add_Constants=n local $gui010 = guicreate('') $Combo1 = GUICtrlCreateCombo("Server language", 32, 8, 113, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Dutch|French|English|German") guisetstate() while 1 switch guigetmsg() case $gui_event_close Exit case $Combo1 msgbox(0,'',guictrlread($Combo1)) EndSwitch WEnd Also, the code that UEZ posted requires 3.3.10 kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Arnol5 Posted December 24, 2013 Author Share Posted December 24, 2013 I Forgot the " " Thx for the fast and good respons everyone 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