Starting field on a form

  • Thread starter Thread starter Stephen Plotnick
  • Start date Start date
S

Stephen Plotnick

I have a form that does get initalized with the cursor in the proper field.
After hitting a button and calling another for I go back and clear the DS
and rebuild a grid; unfortunately the active field is still the button and I
need it to be in the grid.

Steve
 
Monitor the form's Activated event, and call your field's Focus() method
from within it.

Private Sub MyForm_Activated(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Activated
MyImportantField.Focus()
End Sub
 
That did the trick....

THanks,
Steve
Tim Patrick said:
Monitor the form's Activated event, and call your field's Focus() method
from within it.

Private Sub MyForm_Activated(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Activated
MyImportantField.Focus()
End Sub
 
Back
Top