faustf

how can change tab order ??

5 posts in this topic

hi  guy i   have  a  gui  with  10  input box ,  how  is possible set a  tab order??? 

 

thankz 

 

Share this post


Link to post
Share on other sites



An AutoIT GUI?

They will tab in the order that you initialize them. 

Share this post


Link to post
Share on other sites

and  if  i wanna  change  ???  i must  re drawing  ??? 

Share this post


Link to post
Share on other sites

Here is a way :

#include <GUIConstantsEx.au3>
#include <WinAPI.au3>

GUICreate("gui", 280, 170)

$b1 = GUICtrlCreateButton("Bouton1", 10, 10, 100, 25)
$b2 = GUICtrlCreateButton("Bouton2", 10, 50, 100, 25)
$b3 = GUICtrlCreateButton("Bouton3", 10, 90, 100, 25)
$bQuit = GUICtrlCreateButton("Exit", 170, 130, 100, 25 )
$bTabOrder = GUICtrlCreateButton("Arrange tab order", 10, 130, 150, 25 )

$i1 = GUICtrlCreateInput("", 120, 10, 150, 25)
$i2 = GUICtrlCreateInput("", 120, 50, 150, 25)
$i3 = GUICtrlCreateInput("", 120, 90, 150, 25)

Local $aOrder = [$b1, $i1, $b2, $i2, $b3, $i3, $bTabOrder, $bQuit]

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $bTabOrder
            _GUISetTabOrder($aOrder)
    EndSwitch
WEnd


Func _GUISetTabOrder($aId)
    Local $hCtrl
    For $i = 0 To UBound($aId) - 1
        $hCtrl = (IsHWnd($aId[$i]) ? $aId[$i] : GUICtrlGetHandle($aId[$i]))
        _WinAPI_SetWindowPos($hCtrl, $HWND_BOTTOM, 0, 0, 0, 0,  BitOr($SWP_NOMOVE, $SWP_NOSIZE) )
    Next
EndFunc

 

2 people like this

Share this post


Link to post
Share on other sites

o thanks so much :)

 

Share this post


Link to post
Share on other sites

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