dhyabi
dhyabi

Reputation: 329

TextBox Highlighting not happening in Desktop C# application

In Desktop C# Form or window I have a search box which is TextBox, when user try to highlight the text Using Ctrl + A, The system release sound. Is there any thing that make the textbox control accept Ctrl + A?

Upvotes: 0

Views: 107

Answers (1)

sajanyamaha
sajanyamaha

Reputation: 3198

Do try this:

       private void textBox1_keyDown(object sender, KeyEventArgs e)
        {
            if (e.Control & e.KeyCode == Keys.A)
                textBox1.SelectAll();
        }

Upvotes: 1

Related Questions