Shahid Ur Rehman Shahid Ur Rehman - 1 year ago 94 Question

Select all the text of textbox on click

i want to select all the text of text-box when mouse click occurs on it.
example is mentioned below

Image Example

Answer Source

You could set SelectionStart and SelectionLength properties as shown below to select the text programatically.

 textBox1.SelectionStart = 0;
 textBox1.SelectionLength = textBox1.Text.Length;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download