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

Do not clear TextBox?

$
0
0
Using the following code, everything is executing how I want, except the text that is transferred to the form Command is highlighted, so on the second keypress it gets deleted. For instance, from the main form, I want to start typing anything, and for that to show in the second forms text box (Which just looks like a command prompt). If I type "Testing" the textbox1.text looks like "esting" because the T is deleted when I type the second character. Does anyone know how to keep this from happening? (From deleting the first character?)

Code:

Public Class Form1

    Public Shared valueFromCommand

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub LaunchForm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
        Command.TextBox1.Text = (e.KeyChar)
        Command.Show()
    End Sub
End Class


Viewing all articles
Browse latest Browse all 27251

Latest Images

Trending Articles



Latest Images

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