Results 1 to 2 of 2

Thread: Problem setting focus.

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    5

    Problem setting focus.

    I Have an MDI form (X1) with a timer running a clock display and loading a second form (X2) with a TextBox1 to captue the answer to a question.
    I am unable to set the focus to Textbox1 on X2 to accept keyboard entry straign away.

    Any suggestion on how to set this in code, I suspect I am putting staements in the wrong place.

    I have checked X2.Textbox1.tabindex=0 and X2.Textbox.tabstop=true

    Suspect I have to code the solution either in the X2_Load section or near the point in X1 where I dim the X2 form and show it.

    Thanks for any help

  2. #2
    Junior Member
    Join Date
    Mar 2005
    Location
    Australia
    Posts
    17

    Re: Problem setting focus.

    just say:
    VB Code:
    1. Private Sub X2_Load(ByVal sender As System.Object, _
    2. ByVal e As System.EventArgs) Handles X2.Load
    3.  
    4. X2.Textbox1.Focus()
    5.  
    6. End Sub

    that should work.

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