Results 1 to 2 of 2

Thread: tabstop programmatically

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    176

    tabstop programmatically

    Hi All

    I created form in WPF application. That form has some TextBox field. When I enter unique number in TextBox1 and that number exists in database rest TextBox fields received according binding data for those fields when I click Tab button. I would like to stop cursor on TextBox2 if field doesn't get data and skip Teif it get data 0. Look is very simple but I cannot figure out why it doesn't work in my case.
    Code:
    Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles TextBox1.LostFocus
            If cvTest.Count > 0 Then
                If Me.TextBox2.Text = ""
                     Me.TextBox2.IsTabStop = True
                Else
                     Me.TextBox2.IsTabStop = False
            End If
    End Sub
    where cvTest collection view. When I press Tab key when cursor in TextBox1, the cursor stop in TextBox2 in any cases. Why? How to fix that simple problem?

    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: tabstop programmatically

    You're handling the LostFocus event of the first TextBox so focus has already shifted. If you Tab away from TextBox2 then you won't be able to Tab back in but it's too late the first time.

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