Disable text box auto focus selection

When you use the tab key to select a text field, all the text in it is automatically selected. What is the easiest way to prevent this? (Setting the selection to none during input or in GotFocus events does not work)

Thank (-:

+3
source share
2 answers

(I assume you are using WinForms)

What you said you already tried works.

If you handle the Enter event in a text field, you can set it to nothing:

Private Sub textBox_Enter(ByVal sender As Object, ByVal e As EventArgs)
    Dim position As Integer = textBox.Text.Length
    textBox.Select(position, position)
End Sub

, , . .

+8

textBox.DeSelectAll().

0

Source: https://habr.com/ru/post/1741414/


All Articles