YuChan Posted January 18, 2021 Share Posted January 18, 2021 hello, have this : Global $GUIlisteConfirmChoix = GUICreate("Confirmer le choix", 314, 162, 1030, 290, -1, $WS_EX_TOPMOST) $GroupBoxConfirmChoix = GUICtrlCreateGroup("", 8, 1, 297, 121) Global $listeConfirmChoix = GUICtrlCreateList("", 96, 16, 121, 97, BitAND($GUI_SS_DEFAULT_LIST, $LBS_SORT)) GUICtrlSetData(-1, "MENU 1|MENU 2|MENU 3") GUICtrlCreateGroup("", -99, -99, 1, 1) $listeChoixConfirmOK = GUICtrlCreateButton("&OK", 65, 131, 75, 25) Global $listeChoixConfirmCANCEL = GUICtrlCreateButton("&Cancel", 162, 131, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $read = GUICtrlRead($listeConfirmChoix) ConsoleWrite("text = " & $read) Why $read is empty ? Please help me Link to comment Share on other sites More sharing options...
junkew Posted January 18, 2021 Share Posted January 18, 2021 (edited) because it has a different name. edit: https://www.autoitscript.com/autoit3/docs/functions/GUICtrlRead.htm Edited January 18, 2021 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Subz Posted January 18, 2021 Share Posted January 18, 2021 Its because you need to select an item first for example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListBoxConstants.au3> Global $GUIlisteConfirmChoix = GUICreate("Confirmer le choix", 314, 162, 1030, 290, -1, $WS_EX_TOPMOST) GUICtrlCreateGroup("", 8, 1, 297, 121) Global $listeConfirmChoix = GUICtrlCreateList("", 96, 16, 121, 97, BitAND($GUI_SS_DEFAULT_LIST, $LBS_SORT)) GUICtrlSetData(-1, "MENU 1|MENU 2|MENU 3", "MENU 1") GUICtrlCreateGroup("", -99, -99, 1, 1) Global $listeChoixConfirmOK = GUICtrlCreateButton("&OK", 65, 131, 75, 25) Global $listeChoixConfirmCANCEL = GUICtrlCreateButton("&Cancel", 162, 131, 75, 25) GUISetState(@SW_SHOW) $read = GUICtrlRead($listeConfirmChoix) ConsoleWrite("text = " & $read & @CRLF) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $listeChoixConfirmCANCEL ExitLoop Case $listeChoixConfirmOK $read = GUICtrlRead($listeConfirmChoix) ConsoleWrite("text = " & $read & @CRLF) EndSwitch WEnd Link to comment Share on other sites More sharing options...
YuChan Posted January 18, 2021 Author Share Posted January 18, 2021 Different name ? junkew Link to comment Share on other sites More sharing options...
junkew Posted January 18, 2021 Share Posted January 18, 2021 sorry, my mistake need more coffee 😉 Its the loop you should add FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
YuChan Posted January 18, 2021 Author Share Posted January 18, 2021 (edited) Button close and cancel don't work. And i can make 1x select and after i can shoose other but don't work Edited January 18, 2021 by YuChan Link to comment Share on other sites More sharing options...
junkew Posted January 18, 2021 Share Posted January 18, 2021 The subz code given in his post works like a charm on my side. Start new script Copy/paste his code and run it FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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