0

In vb6 form I've 1 Textbox, 2 option buttons & 1 command button
my need is I want to move from one option button to other by pressing
Tab key. Help me out. This is customer requirement.

4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Jx_Man
0

you have to set the TAB INDEX property of the option buttons. select the desired control and press F4 to open its properties,scroll down and find the tab index property. there you put the value. this value becomes the sequence number after which the focus will be moved to the desired control.

For example, if you set tab index of option1 to 0 and option 2 to 1, whenever you open the form the option 1 will be selected as default. then you can press tab to easily move the focus from option 1 to option 2. in the same way you can also set the tab index for other controls also.

hope this will help.

regards
Shouvik

0

HI Rajesh,

If your need s about alternatively set focus to the option buttons,

then the tabindex propery mightnot complete your obligation

you can acheive it by using arrow keys(any one in four arrow keys...),

place the option buttons in a frame

now use arrow key to change selection(single key-no need to use different keys to move the selection)

i hope this will help you,

with regards
venkatramasamy SN

0

actually Shouvik and venkatramasamy was given the solution but if you want to try other way you can use enter keys.

Private Sub Option1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Option2.SetFocus
End If
End Sub

may help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.