Jump to content

Recommended Posts

Posted

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
Posted

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!

Posted

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. :ILA2:

:rolleyes:

Posted

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...

Posted

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:

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...