Highlight text in a textbox

  • Thread starter Thread starter Cox
  • Start date Start date
Cox,
I suspect in this context Read The Manual.

Although normally I use RTM for Release To Manufacturing.

Hope this helps
Jay
 
I just tried the 'Select' with my app and it wasn't highlighted. The code:
private System.Windows.Forms.TextBox txtLeftOperand;

.......

txtLeftOperand.Select(1,2);

Any ideas on what I might be doing wrong? My environment is Visual Studio
..NET 2003



Mike
 
Hi,
to select (highlight) characters 1 through 10 in a text box

textbox1.Select( 1, 10 );

To get the present cursor psition you can use the textbox.SelectionStart
property (textbox1.Select( textbox.SelectionStart, 10 );).
If you use a richtextbox you will be able to change the color or font of the
selected text (richtextBox.SelectionColor, richtextBox.SelectionFont).

--
Mit freundlichen Gruessen - Regards

Ralph Gerbig
(e-mail address removed)
www.ralphgerbig.de.vu
 
Back
Top