Posted 2 years ago by Mike
Version: 17.2.0665
Avatar

Hi,

how can I subscribe to the scroll event of the vertical scrollbar? The editor scrollbar.scroll event does not fire. The ActiveView.Scroller does not have any event I can subscribe to.

 

//Edit: I want to override the scroll behavior. So I would need to get informed if the user scrolls up/down, which direction + disable internal scroll mechanisms of the editor. I can override the MouseWheel event but that doesn't deal with up/down arrow scrolling.

[Modified 2 years ago]

Comments (3)

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mike,

You can watch the editor.ActiveView.TextAreaLayout event to know when a layout occurs.  It can happen for more than just vertical scrolling (i.e. resizing, etc.), and will cover all cases.  But since many things can trigger a layout (even multiple things at the same time sometimes), there isn't an indicator of what originally triggered it.

But there isn't a way to block scrolling.  And remember scrolling can happen simply by moving the caret, which occurs from many edit actions.  

Can you describe more about your scenario and why you are wanting to block scrolling?


Actipro Software Support

Posted 2 years ago by Mike
Avatar

Hi,

the document is dynamically built (lines get appended/added on scroll). Its basically an endless document and therefore I need an endless scroll behavior. As of now we are using a slider + attached to the Scrollviewer.scroll event which exists on most controls but on Syntax Editor this event does not fire.

I've already guessed it would be much more complicated if Syntax Editor does not have such an event as like you said, there are plenty of things to take care of. I don't know how SyntaxEditor internally works but do you think you can add this event in next release? Maybe just expose the internal scroll event?

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mike,

Couldn't you watch the ActiveView.TextAreaLayout event I mentioned?  If you see it reaching a certain point (you can watch editor.VisibleViewLines' last line's position to know how far it's scrolled), then add more text to the document.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.