Home All Groups Group Topic Archive Search About

Starting field on a form

Author
27 Oct 2006 5:50 AM
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

Author
27 Oct 2006 1:47 PM
Tim Patrick
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

-----
Tim Patrick
Start-to-Finish Visual Basic 2005

Show quoteHide quote
> 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
>
Author
27 Oct 2006 2:12 PM
Stephen Plotnick
That did the trick....

THanks,
Steve
Show quoteHide quote
"Tim Patrick" <inva***@invalid.com.invalid> wrote in message
news:e3b469760f008c8c7aadf083c02@newsgroups.comcast.net...
> 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
>
> -----
> Tim Patrick
> Start-to-Finish Visual Basic 2005
>
>> 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
>>
>
>