I have a weird problem (perhaps just for understanding) why in the test application, the rect focus is not displayed until I press the Tab key.
I want to show a dialog with two radio boxes and two buttons. When I show the dialogue, I would like to see the focus around my first radio drum. (So that the user can see where the focus is.) I ordered the controls and set the tabindex property from 0 to 4 so that they are in the correct order. (radobox 1 has tabindex 0, ...)
When I show the dialogue, the first radio lens has focus, but it does not focus around it. (Until I press the tab key.)
I created a completely empty winforms project (Visual Studio 2010), added controls, and started it. So there is nothing special.
Can someone tell me what I'm doing wrong?
Sorry, here is the code for my example:
Public Class Form1
Private Sub Button1_Click(sender As System.Object, _
e As System.EventArgs) _
Handles Button1.Click
Me.Close()
End Sub
Private Sub Button2_Click(sender As System.Object, _
e As System.EventArgs) _
Handles Button2.Click
Me.Close()
End Sub
Private Sub Form1_Shown(sender As Object, _
e As System.EventArgs) _
Handles Me.Shown
RadioButton1.Focus()
RadioButton1.Select()
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("+{TAB}")
End Sub
End Class
Alexs source
share