We help IT Professionals succeed at work.

"Go To Line" in a textbox.

Javin007
Javin007 asked
on
1,220 Views
Last Modified: 2010-05-18
Simple question, can't find the answer.

I can retrieve the line that I want in a RichTextBox control (multiline) and now I want to "go" to that line.  Basically, I've got an RTB that's getting data added to it constantly.  When my "autoscroll" is turned on, I simply set the .SelStart to the end of the document, and that works passingly.  Now I want to be able to turn off the scroll, and have the RTB just sit there.  Unfortunately, every time the data in the RTB is swapped (I have to generate the .rtf myself) the box moves back to the beginning of the "document."

-Javin
Comment
Watch Question

Try this:

RichTextBox1.SelStart = Len(RichTextBox1)

if you are already doing this , then supply more code.  and explain more.

Author

Commented:
I don't really know how much more simply to put it.  I've got a multi-line textbox, I want to "jump to" line 183.  (WITHOUT having to cycle through 183 instr's to trying to set the SelStart past each vbCrLf.  This will not be accepted as an answer.)

-Javin
Ark
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Ark
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Okay, explanation of my point split:

For some bizzare, and unknown reason, the app has STOPPED (with no additional coding or changes of properties that I can find) giving me the problem I was having before.  HOWEVER.

I awarded Ark 200 points because he has helped me in some fashion or another with multiple other issues that he wasn't awarded for.

I awarded 100 to unknown routine for a valiant attempt.

I awarded 100 to BlueDevilFan for an attempt, however, it was similar to another bit of code given in another avenue that didn't work out like I'd wanted.  (visible scrolling issues with each change.)

I awarded 100 to "Learning t0 pr0gram" (despite his attempted 1337 nick) because his option seemed that he'd actually put some thought into it, though it wasn't quite related to my problem...

-Javin
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.