Thank you very much for your help.
That's what I was looking for.
Thanks again
Thank you for your reply.
I am using textbox with "MultiLine" set to yes, and I set "scroll bar" to
"both".
For example, say I have 2 pages of data (meaning, I can only go to the 2nd
page of data when I hit the vertical scroll on the textbox), and my search
word is found on the 2nd page.
How can I automatically scroll to the 2nd page of the multiline text box ?
Thank you.
You want something like MS Word's paged layout. The sample above does
the job in Textbox control which does not support a kind of layout
like seperate pages, as you requested as "textbox" in your first post.
So the implementation may depend on how to use "pages" and how you
mean pages in your project. What exactly do you mean by calling
"pages"? Seperate textboxes , RichTextBox or other control?
Thanks,
Onur Güzel
Now i hope i understood, you're talking about one and the same textbox
control which is structured by your own as pages, so you want your
unique textbox to be scrolled when and where the text is found?
So, i've found ScrollToCaret method which should do what you want, so
the extended code will look like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TextBox1.Focus()
TextBox1.SelectionStart = TextBox1.Text.IndexOf(TextBox2.Text)
TextBox1.SelectionLength = TextBox2.Text.Length
' Go to selectedtext piece and scrool
TextBox1.ScrollToCaret()
End Sub
Hope this helps, let us know...
Thanks,
Onur Güzel