Results 1 to 3 of 3

Thread: Simple question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344
    How do I make it that when my form opens up a certain text box has priority....example form opens up cursor to type would be shown, and if i was to click enter it would press a certain command button? Any ideas?
    -RaY
    VB .Net 2010 (Ultimate)

  2. #2
    Guest
    Use the SetFocus method.
    Code:
    Private Sub Form_Activate()
        MyTextBox.SetFocus
    End Sub

  3. #3
    Lively Member
    Join Date
    Aug 2000
    Posts
    114
    You can do a couple of things. Set the TabIndex property of the text box to 0 or use the a statement like text1.setfocus. For the command buttom part of your question set the Default property to that buttom to true and then when you hit enter the command_click will be executed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width