Scrollbars - How to make scroll a page of text at a time

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Matt Adamson
Avatar
I'm using a ScrollBar control when using two syntax editor controls similar to the TextDiff application and have an issue that the scroll bar does not page down to the next page of lines rather it pages half way down.

If you review the TextDiff sample application you will see this issue perfectly. i.e. lines 1 - 28 are visible initially and then you scroll down a page and see 11 - 38, what I'd like is to see 29 - 56.

Comments (5)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

Actually it is working properly as is. The scrollbars work such that they scroll down (number of visible display lines - 1). In the TextDiff sample, there are some display lines that don't have text on them but nevertheless they are display lines and count per that formula.

If you'd like to change the behavior for a diff app of your own, then you could remove our page down command bindings and write your own page down commands that perform how you'd like.


Actipro Software Support

Posted 17 years ago by Matt Adamson
Avatar
I'm confused as the number of visible display lines is 28 so if you scroll a page down why don't you go a further 28 down?

In relation to the customisation you mentioned on page down command bindings, what exactly do you mean? How do you change these, are these events / attributes on objects?
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It is going down 27 display lines. On the left the second last display line number (but not index) is 14 and on the right, the second last display line number is 27. Page down and both of those are at the top. Remember that for this demo, the display lines have custom line numbering so even though that left side said line 14, it was really display line with index 27. Some of the display lines just aren't showing a number. This QuickStart is just for demonstration purposes on what you could do.

The SyntaxEditor.CommandLinks collection contains a number of command links for handling all keys. You can remove the one for the PageDown key and write your own command that inherits EditCommand and add it via a CommandLink to the SyntaxEditor instead. There is a QuickStart on commands you can look at.


Actipro Software Support

Posted 16 years ago by Matt Adamson
Avatar
Actually just revisiting this now, nearly a year on :)

It's not actually paging down I was doing, rather I was selecting the portion in the scroll bar just below the rectangle. When the scroll bar moves down a "rectangle" at a time, this doesn't represent a whole page in the editor.

How do I change the amount it scrolls here if I use a single vertical scroll bar for the two editors, just like the quick start sample does. I guess I need the rectangle to be bigger.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Matt, sorry I'm not quite sure what you mean. Maybe you can email us a simple project with repro steps to show it happening.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.