BLNJ000 Posted March 20, 2020 Posted March 20, 2020 Hello , I am new to the forum and I started getting interested in scripts a few days ago , so I apologize if I had to write nonsense. I would need to understand how to "read" (or use ?) the values that I put ( write) in the inpuptbox of the script . I have read and searched in the various examples that I managed to find but I must have missed something because in the test script that I am writing I cannot "see" these blessed values. For now I would simply like to see them in the message at the ok button [value 1 = ..... value2 = ....] but they don't fit. ( later they will be written on txt or used in the rest of the script but if I don't read them here it will have problems even after ... ) I ask if anyone can please tell me what I did wrong and what I should pay particular attention to in the future. this is where i got stuck (message button "ok") expandcollapse popup;#include <Array.au3> ;#include <WinAPIShPath.au3> ;#include <WinAPIFiles.au3> #include <MsgBoxConstants.au3> #include <ColorConstantS.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> Var1e2() Func Var1e2() Global $hGUI = GUICreate("value test 1 e 2", 700, 210) GUISetBkColor(0xffffff) GUISetFont(13, 200) Global $idLabel = GUICtrlCreateLabel("value 1", 20, 10, 130, 20) GUICtrlSetColor($idLabel, $COLOR_RED) $imp1 = GUICtrlCreateInput("", 20, 40, 550 ,25) _GUICtrlEdit_SetCueBanner($imp1, "write valuee 1",True) ;If @error Then Exit $wCas1 = GUICtrlRead($imp1) GUISetFont(13, 200) $idLabel = GUICtrlCreateLabel("value 2 ", 20, 80, 130, 20) GUICtrlSetColor($idLabel, $COLOR_RED) $imp2 = GUICtrlCreateInput("", 20, 110, 550 ,25) _GUICtrlEdit_SetCueBanner($imp2, "insert valueee 2",True) GUISetFont(14, 300) Global $iOKButton = GUICtrlCreateButton("OK", 70, 160, 60) GUISetFont(10, 300) Global $AnnullaButton = GUICtrlCreateButton(" ESC ", 150, 160, 90 ) GUISetState(@SW_SHOW, $hGUI) Local $iMsg = 0 While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $iOKButton ;MsgBox($MB_SYSTEMMODAL, "GUI Event", "You selected the OK button.") MsgBox($MB_SYSTEMMODAL, "GUI Event", $wCas1 & @CRLF $imp2) ExitLoop Case $AnnullaButton MsgBox($MB_SYSTEMMODAL, "GUI Event", "you canceled the entry , try again") ;ExitLoop Case $GUI_EVENT_CLOSE MsgBox($MB_SYSTEMMODAL, "GUI Event", "You selected the Close button. Exiting...") ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Var1e2 (I probably also have too many includes) note = note = the data entered are text (letters + numbers)
Subz Posted March 20, 2020 Posted March 20, 2020 (edited) Use GuiCtrlRead to read the controls. MsgBox(4096, "GUI Event", GuiCtrlRead($imp1) & @CRLF & GuiCtrlRead($imp2)) Edited March 20, 2020 by Subz
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