Textbox property to select Appended text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johnpapa
    New Member
    • Apr 2014
    • 3

    Textbox property to select Appended text

    I use Autocomplete SuggestAppend in relation to a textbox.

    Assuming my textbox shows numbers and the dropdown list contains for example
    12312
    13411
    14511
    15611

    If I type "1" I will see in the textbox "12312" with "2312" appended and the dropdown list showing the options. I can use textbox.Text to get the "1" which I typed.

    How can I get the entire textbox value ie "12312" (the "1" and the appended "2312")?

    Thanks
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    not sure what you are attempting to do but could you test the keypress and depending on the key write the required string to the TextBox, e.g.
    Code:
        Private Sub TextBox1_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
            If e.KeyChar = "1"c Then
                TextBox1.AppendText("12345")
            End If
            e.Handled = True
        End Sub
    when 1 is kit 12345 is writen to the TextBox

    Comment

    Working...