"Aung Thu" <Au*****@discussions.microsoft.com> schrieb:
I want to set focus on a control, of which TabIndex is not the first, when
a
form is loaded. In the form's load event, I have used Control.Focus() but
it
doesn't not work. The focus is not on the control I set. The focus is
always
on the control of which TabIndex is 0.
\\\
Private Sub Form1_Activated( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Activated
Static IsActivated As Boolean
If Not IsActivated Then
IsActivated = True
Application.DoEvents() ' ...
Me.TextBox1.Focus()
End If
End Sub
///
In .NET 2.0 Windows Forms forms have a 'Shown' event.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>