Scroll bar showing top line line number when scrolling

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Matt Adamson
Avatar
Is it possible to show perhaps as a tooltip on the scroll bar the current line no e.g. when scroll through a large file say 1- 5000 lines you want to see it update to show the top most line number if you were to stop scrolling at that point.

Comments (7)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes there is a VerticalScrollBarHintEnabled property that does this.


Actipro Software Support

Posted 12 years ago by Matt Adamson
Avatar
Thanks, so how does the VerticalScrollBarHintDefaultText property effect this, does this string value accept place holders e.g.

Line No {LineNo}

I'm confused as the documentation states very little and has no example.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok, the docs are improved for this for the next maintenance release.

Here's the portion added to the VerticalScrollBarHintDefaultText property:

This text is used in the scrollbar hint popup when the VerticalScrollBarHintEnabled property is true and scrolling occurs.

This hint text supports the markup constructs that you can use for quick info so bold, italics, etc. are supported. Also you may specify {0} for the current line number and {1} for the total line count.


Actipro Software Support

Posted 12 years ago by Matt Adamson
Avatar
:) - I've just found out this doesn't work, although it's more than likely because I'm using a separate vertical scroll bar ( i.e. similar to the TextDiff sample app ) to control the scrolling of both syntax editor controls.

Any idea how I can easily achieve this to show the line numbers from the right most syntax editor control when scrolling this scroll bar?
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ahh yes, ours only works if you use a built-in SyntaxEditor scrollbar. You'd have to create and show your own tooltip and update it based on the scroll events of your scrollbar.


Actipro Software Support

Posted 12 years ago by Matt Adamson
Avatar
Would you mind sharing any of the code in the syntax editor which would help do this in the scroll bar?

Any specific events I'd need to add the code too

Many thanks
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

Our code for doing this uses internal popup and label controls along with an internal scrollbar control. You'd have to use the .NET standard ScrollBar and ToolTip controls to do it externally so the way you would do it wouldn't be the same as how we do it.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.