show selected text in a textbox

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

I have a big multiline Textbox with scrollbars. I want to be able to look
for a substring in the textbox, and select it. So far no problem.

But: when the selected piece of text in the textbox isn't visible, I want it
to be visible! So I need to let the scrollbars scroll until the selected
text is visible or something like that. Is there a function liek that in
VB.NET? Or how can I accomplish this?

Thanks a lot,

Pieter
 
* "DraguVaso said:
I have a big multiline Textbox with scrollbars. I want to be able to look
for a substring in the textbox, and select it. So far no problem.

But: when the selected piece of text in the textbox isn't visible, I want it
to be visible! So I need to let the scrollbars scroll until the selected
text is visible or something like that. Is there a function liek that in
VB.NET? Or how can I accomplish this?

Set the focus to the control and call its 'ScrollToCaret' method.
 
Back
Top