2,892 questions
You can do for example :
Dim nStart As Integer = RichTextBox1.GetFirstCharIndexFromLine(0)
Dim nLength As Integer = RichTextBox1.Lines(0).Length
RichTextBox1.Select(nStart, nLength)
RichTextBox1.Focus()
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am having a problem selecting the first line of a richtextbox. I fill the rtb with text and all I want to do is when the text is loaded into the box I want the first line highlighted.
Can someone help me?
Thanks
Les
You can do for example :
Dim nStart As Integer = RichTextBox1.GetFirstCharIndexFromLine(0)
Dim nLength As Integer = RichTextBox1.Lines(0).Length
RichTextBox1.Select(nStart, nLength)
RichTextBox1.Focus()