winforms - How can I scroll to a specified line number of a RichTextBox control using C#? -
how can scroll specified line number of richtextbox control using c#? it's winforms version.
you can try this.
void scrolltoline(int linenumber) { if (linenumber > richtextbox1.lines.count()) return; richtextbox1.selectionstart = richtextbox1.find(richtextbox1.lines[linenumber]); richtextbox1.scrolltocaret(); }
this not work if have lots of repetition within richtextbox. hope might of use you.
Comments
Post a Comment