tags:

views:

126

answers:

3

How do I allow select all in my multi-lined TextBox?

It seems weird to me that there would not be a way to do this; there should be something in the framework out of the box.

+7  A: 

In case of Windows Forms:

textbox.SelectAll();
olle
Works for WPF textboxes too.
CannibalSmith
A: 

How about textbox1.SelectAll()?

You can also use

textbox1..Select(0, textbox1.Text.Length);

and turn property HideSelection to False.

TheVillageIdiot
+1  A: 

Try the SelectAll method (actually located on TextBoxBase).

TextBoxBase b = GetTheTextBox();
b.SelectAll();
JaredPar