views:

127

answers:

1

I ahve a RTB with sufficent text that scrolling is needed
user enters a string and I highlight all occurrences using a combination of Find and Select which is great but now I want the ability for a user to press Next and the next higlighted instance should be visible say 2at /3rd of the bounding rectangle ( I would even settle for at the top of the bound.

How do I scroll to an index basically ( I am caching the indices as I find and markup )

oh also this is C# Winforms .NET 2.0

+1  A: 

Set the selection start to the next location, and then use ScrollToCaret to scroll to that location in the rich text box.

rText1.SelectionStart = i
rText1.ScrollToCaret()
xpda