User Profile
Collapse
-
Thanks for the reply Luk3r. Unfortunately adding e.SuppressKeyPr ess = true; doesn't make a difference. I actually have that in the code already to suppress the beep that occurs on a non-multiline TextBox. What's odd about my problem is that if I use the keyboard to enter text into the TextBox, then press the Enter key, then it works - all of the text gets selected. But if I use a barcode reader to enter text into the TextBox (with an automatic Cr),... -
TextBox.SelectAll() doesn't work - sometimes
Using VS2008, Windows Forms Application
In a TextBox::KeyDow n event I check to see if the Enter Key has been pressed, and if so, I perform some action then attempt to select all of the text using SelectAll(), as follows:
Code:private void SelectAllTextBox_KeyDown(object sender, KeyEventArgs e) { if (Keys.Enter == e.KeyCode) { PerformSomeAction(); SelectAllTextBox.SelectAll();
No activity results to display
Show More
Leave a comment: