Starting field on a form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stephen Plotnick

    Starting field on a form

    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


  • Tim Patrick

    #2
    Re: Starting field on a form

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

    Private Sub MyForm_Activate d(ByVal sender As Object, ByVal e As System.EventArg s)
    Handles Me.Activated
    MyImportantFiel d.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
    >

    Comment

    • Stephen Plotnick

      #3
      Re: Starting field on a form

      That did the trick....

      THanks,
      Steve
      "Tim Patrick" <invalid@invali d.com.invalidwr ote in message
      news:e3b469760f 008c8c7aadf083c 02@newsgroups.c omcast.net...
      Monitor the form's Activated event, and call your field's Focus() method
      from within it.
      >
      Private Sub MyForm_Activate d(ByVal sender As Object, ByVal e As
      System.EventArg s) Handles Me.Activated
      MyImportantFiel d.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
      >>
      >
      >

      Comment

      Working...