Does anyone have idea how I can move the cursor to a certain line number in the Richtext edit?
Something like, Go to line number: _____ and then clicking OK button jumps the cursor to that line?
Your help is much appreciated.
Thanks.
Richtext - How to Goto Line number?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Mike GoldRank #50 · 30.6K pointsPosted Jul 30, 2007, 2:41 PM EDT
/// <summary> /// Go To a particular line /// </summary> /// <param name="i"></param> private void GotoLine(int i) { int index = richTextBox1.GetFirstCharIndexFromLine(i-1); richTextBox1.Select(index, 0); }Andrew3 pointsPosted Jul 30, 2007, 2:55 PM EDT
I have been googling around most of a day just to find the solution, and even went to Win32 API, but could not find one working.
In addtion, this is the first time I post question here and I am very happy to find a place where I there are helpful developers that shares knowledge and experience.
Again, thank you Mike and CSharpcorner.
Mike GoldRank #50 · 30.6K pointsPosted Jul 30, 2007, 10:40 PM EDT
it's a pleasure to help out.
Best,