Sign in to follow this  
Followers 0
Terenz

The mistery of radio control

3 posts in this topic

#1 ·  Posted (edited)

Hello,

I have test this on two OS with different architecture and i can't exaplain the reason:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 287, 148, -1, -1)
$Radio1 = GUICtrlCreateRadio("Radio1", 16, 16, 113, 17)
$Radio2 = GUICtrlCreateRadio("Radio2", 16, 48, 113, 17)
$Button1 = GUICtrlCreateButton("Button1", 96, 96, 75, 25)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

I'm using TAB very often for switch between control. For an unknow reason in the example i have posted tabbing goes to Button to the first Radio and from the first Radio to Button ignoring the second radio control! I have try with

2 combobox, the switch work

1 radio and 1 combobox,  the switch work

With 2 radio i have that issue, the code is so simple that is impossible i have make a mistake. I don't know if is an autoit bug ( oh no i have say that word ) or a strange Windows behavior since i can't find nothing about this.

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

That's normal radio behaviour. For going to radio in same group you have to use mouse or cursordown. This behaviour is needed as a radio which get focus toggle it's state to checked.

Share this post


Link to post
Share on other sites

#3 ·  Posted

Found the answer:

The window is a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.

The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to Group

Autoit assing the first checkbox created on the list the WS_TABSTOP style so the other ones are considered in the same group.


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

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
Sign in to follow this  
Followers 0