"Dominique Gratpain" <no****@devdex.com> schrieb:
If I put SendKeys.Send("{F10}{ENTER}") in the event of a button on the
form, it is always good.
But if I put that in the event of the form load, sometines it is good,
sometimes it does nothing and sometimes the cursor becomes the wait
cursor but i have the hand.
In which event, can we put the sendkeys to open the menu with the form ?
The form's 'Load' event handler is called when the form is not yet visible.
Make sure the for is visible, enabled and the active form before calling
'SendKeys'.
Untested:
\\\
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()
' Call 'SendKeys' here.
End If
End Sub
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>