ScrollToCaret Overload

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by Marianne
Avatar
The current behavior of ScrollToCaret is that if it's scrolling down it will stop as soon as the line with the caret is in view, which would put that line at the very bottom of the viewable window. What I'd like to see is an option that will put the line X lines from the top.

Can you add an overload to ScrollToCaret that accepts an int that will do that?

In other words, ScrollToCaret(0) would ensure that the careted line is always the topmost line in the view window (unless there's not enough room at the bottom of the docmument to accommodate this, in which case the scrolling should be as far as allowable). And a ScrollToCaret(15) would put the caret in the middle of a 30-line window.

The biggest worry is if someone puts in a number that's larger than the current size of the window, in which case, default to the normal behavior.

Thanks.

------------------------------- Marianne

Comments (2)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok, I'll add this or something similar to the TODO list. Have you seen the FirstVisibleLine property though? You can get and set that.

[ 06-22-2004: Message edited by: Actipro Software Support ]


Actipro Software Support

Posted 20 years ago by Marianne
Avatar
I saw it after I posted. Am using it now. Thanks!

------------------------------- Marianne

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.