Efo74 Posted September 4, 2012 Posted September 4, 2012 Hello, Is there a way to disable the ability to focus Buttons. Example: I have a form with 4 buttons, I would like to select (focus) only 2 buttons with "TAB" key. Thank you :rolleyes:
Moderators JLogan3o13 Posted September 5, 2012 Moderators Posted September 5, 2012 You should be able to do something with GUICtrlSetState, if I am understanding your question correctly. How about providing a small reproducer to show us what you're trying to do? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Efo74 Posted September 5, 2012 Author Posted September 5, 2012 Excuse me for the delay ... I'm at work. Here is an example: #include GUICreate("My GUI Button") $Button_1 = GUICtrlCreateButton("Botton 1", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Botton 2", 10, 60,100) $Button_3 = GUICtrlCreateButton("Botton 3", 10, 90, 100) $Button_4 = GUICtrlCreateButton("Botton 4", 10, 120,100) GUISetState() GUICtrlSetState($Button_2,$GUI_NOFOCUS) GUICtrlSetState($Button_3,$GUI_NOFOCUS) While 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEnd I would like to press "TAB" button on keyboard and the buttons must select "focus" only : button 1 and button 4. If I utilize the mouse , I can press all the button .... but If I use the "TAB" I would like only button 1 and button 4. Is that possible ??? Thank you. :rolleyes:
rover Posted September 5, 2012 Posted September 5, 2012 Hello, Is there a way to disable the ability to focus Buttons. Example: I have a form with 4 buttons, I would like to select (focus) only 2 buttons with "TAB" key. Thank you You have to remove the $WS_TABSTOP style #include <GUIConstantsEx.au3> GUICreate("My GUI Button") $Button_1 = GUICtrlCreateButton("Botton 1", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Botton 2", 10, 60, 100) $Button_3 = GUICtrlCreateButton("Botton 3", 10, 90, 100) $Button_4 = GUICtrlCreateButton("Botton 4", 10, 120, 100) GUISetState() GUICtrlSetStyle($Button_2, 0) ;$GUI_SS_DEFAULT_BUTTON = 0 GUICtrlSetStyle($Button_3, 0) ;$GUI_SS_DEFAULT_BUTTON = 0 While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEnd I see fascists...
Efo74 Posted September 5, 2012 Author Posted September 5, 2012 I have found that $WS_TABSTOP in other forum posts, but I can't make work the script. Can you make me an example ? :rolleyes:
Moderators JLogan3o13 Posted September 5, 2012 Moderators Posted September 5, 2012 Efo74, did you try the code rover posted? It is exactly what you're requesting. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Efo74 Posted September 5, 2012 Author Posted September 5, 2012 Ohhh. Excuse me... but I'm not see that you change GUICtrlSetState with GUICtrlSetStyle . This is exactly what I'm looking for.Thank you , Thank you very much. :rolleyes:
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