CatchFish Posted October 10, 2005 Share Posted October 10, 2005 Is there a way to prevent focus marks showing on GUI buttons? Just like the buttons on the toolbar of Word Pad. When you click the PASTE button, it does not have a focus at all, does it? How can I implement this on button controls?I've used some tricks to emulate it:#include <GUIConstants.au3> $MainWindow = GUICreate("Test", 403, 461, -1, -1) $ButtonNew = GUICtrlCreateButton("N", 6, 5, 23, 22) ; Click this button... $InputDummy = GUICtrlCreateInput("", -99, -99, 1, 1, $ES_READONLY) While 1 $msg = GuiGetMsg() Select Case $msg = $ButtonNew GUICtrlSetState($InputDummy, $GUI_FOCUS) ; ...will move focus to dummy input Case Else ;;; EndSelect WEndBut still an imperfection -- I do a click-n-drag on the button, and the focus is not moved! Besides, there's a heavy border left on the button even if a normal click is performed...So I'd prefer a REAL style of button controls which is similar to the "hidefocus" property of a web button. Any suggestions? Thanks.(ps. I searched the forum and found a method to remove $WS_TABSTOP style of a button. Very useful, but not enough for a toolbar button... ) Link to comment Share on other sites More sharing options...
LxP Posted October 14, 2005 Share Posted October 14, 2005 I believe that toolbar buttons are implemented differently to your typical Windows button. Toolbar buttons are designed not to show a focus rectangle because (at least in my experience with standard toolbar buttons) they'll never receive keyboard focus anyway.I have almost no experience with AutoIt GUIs but you may be able to achieve what you desire with some clever GUICtrlCreatePic() work and create your own custom-drawn 'button'. Since it wouldn't be a standard button you'd no longer need to worry about focus rectangles. Link to comment Share on other sites More sharing options...
Lazycat Posted October 14, 2005 Share Posted October 14, 2005 I use for imitate this behaviour combination of styles BS_CHECKBOX and BS_PUSHLIKE: $ButtonNew = GUICtrlCreateButton("N", 6, 5, 23, 22, BitOR($BS_CHECKBOX, $BS_PUSHLIKE)) If I right undersand your problem. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) 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