Gustavo Lago Posted October 4, 2006 Share Posted October 4, 2006 How to select the all text of the GUI Input when to catch the focus? thanks, Gustavo Link to comment Share on other sites More sharing options...
jvanegmond Posted October 4, 2006 Share Posted October 4, 2006 This is the best I can come up with. Press Close to select: #include <GUIConstants.au3> $Form1 = GUICreate("AForm1", 297, 236) $Edit1 = GUICtrlCreateEdit("Text to select??", 0,0,297,236) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUICtrlSetState($Edit1,$GUI_FOCUS) Send("+{HOME}") EndSelect WEnd Exit If I were to rate this, I wouldn't even give it a 4 out of 10. It's a bad solution to a simple problem I can't get my head around.. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Gustavo Lago Posted October 4, 2006 Author Share Posted October 4, 2006 Tanks!! My code: #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form", 203, 160, 193, 115) $Input1 = GUICtrlCreateInput("00", 16, 32, 41, 26, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER)) GUICtrlSetLimit(-1,2) $Input2 = GUICtrlCreateInput("12345678", 72, 32, 113, 26, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER)) GUICtrlSetLimit(-1,8) $Button1 = GUICtrlCreateButton("&Consultar", 16, 128, 75, 25, 0) $Button2 = GUICtrlCreateButton("&Fechar", 112, 128, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Foco = "" While 1 $nMsg = GUIGetMsg() ;If $nMsg <> 0 Then;GUICtrlSetData($Label1, ControlGetFocus("")) Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ;;;;;;; Case Else If $Foco <> ControlGetFocus("") Then $Foco = ControlGetFocus("") If $Foco = "Edit1" Or $Foco = "Edit2"Then Sleep(100) Send("{HOME}+{END}") EndIf EndIf EndSwitch WEnd 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