RichTextBox

G

Guest

I have several lines of text in an rtb control that is populated by a sqldatareader when a user selects an item in a combobox. How do I make a line that has specific text I'm searching for display at the top of the rtb? In other words, I want to scroll the text until that specific word/phrase is at the top left of the control. So far the text shows up at the bottom of the rtb.

Thank you,
Richard
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?UmljaGFyZA==?= said:
I have several lines of text in an rtb control that is populated by a
sqldatareader when a user selects an item in a combobox. How do I make a
line that has specific text I'm searching for display at the top of the
rtb? In other words, I want to scroll the text until that specific
word/phrase is at the top left of the control. So far the text shows up
at the bottom of the rtb.

Untested:

\\\
With Me.RichTextBox1
.Select(PosFound, 0)
.Focus()
.ScrollToCaret()
End With
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top