Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27020

Text Box Problem

$
0
0
Hello,
I am trying to select a textbox by pressing the "F10" key, and then enter some text.
Everything works, except the first number entered is ignored. If I enter 5 6 7 8, it shows as 678.
(using VBexpress 2010)

HTML Code:

Private Sub mainform_keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    If e.KeyCode = Keys.F10 Then
        TextBox12.BackColor = Color.Aqua
        TextBox12.Select()
        TextBox12.Focus()
    ElseIf e.KeyCode = Keys.Enter Then
        TextBox12.BackColor = Color.White
    End If
 End Sub

Using TextBox12.Select() or TextBox12.SelectAll() doesn't make any different
If I select the textbox with the mouse it is fine.

What am I missing?

gerryc

Viewing all articles
Browse latest Browse all 27020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>