Skdp Posted September 6 Share Posted September 6 (edited) Greetings, when I create a GUI with AutoIt if I click on a button the focus is automatically created, is it possible to hide it? The focus should disappear both if I don't click the button and if I click it. Edited September 6 by Skdp Link to comment Share on other sites More sharing options...
argumentum Posted September 6 Share Posted September 6 create a button outside the canvas and set focus to that. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Andreik Posted September 6 Share Posted September 6 (edited) Just use ControlFocus() and focus another control or if you want to prevent dotted focus lines then check out this thread. #include <WinAPISysWin.au3> $hGUI = GUICreate('Test') $cButton = GUICtrlCreateButton('Click Me', 100, 100, 100, 30) $hButton = GUICtrlGetHandle($cButton) $cDummy = GUICtrlCreateLabel('', 0, 0, 0, 0) GUISetState(@SW_SHOW, $hGUI) While True Switch GUIGetMsg() Case -3 ; GUI_EVENT_CLOSE Exit Case $cButton MsgBox(0, '', 'You clicked the button') EndSwitch If _WinAPI_GetFocus() = $hButton Then ControlFocus($hGUI, '', $cDummy) WEnd Edited September 6 by Andreik When the words fail... music speaks. 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