ActiproSoftware.WinUICore.ScrollBar & VerticalScrollBarHint

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Dan Oren - Software Developer, Watchfire
Version: 4.0.0234
Avatar

Hey,

I'm using the 2 syntax Editor controls side by side in order to implement a diff control.(like in 4.0 TextDiffForm.cs).
The Scroll (like in the sample ) is an independent control (ActiproSoftware.WinUICore.ScrollBar)

I want to show the line numbers when scrolling like I had it when I scolled the SyntaxEditor with its scrollbar.( using VerticalScrollBarHint options)

How can I implement this ?

Dan

Dan Oren

Comments (5)

Posted 13 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
Hi Dan,

I do the same thing with a Diff control. The approach I took was to use the built-in SyntaxEditor scrollbars. I have two editors... one of the left, one on the right. For the SyntaxEditor control on the left, I set the scrollbar style to be Horizontal only (basically hide the vertical bar). For the SyntaxEditor control on the right, I set the scrollbar style to Horizontal and Vertical. This provides a single vertical scrollbar with two independent horizontal scrollbars. I then just monitor the vertical scroll events on the right control to keep the left control in sync.

Since I use the built-in scrollbar, I still get the hints :)
Posted 13 years ago by Dan Oren - Software Developer, Watchfire
Avatar
Hey,

I did it but I have problem when the size of the text is different and the right side has more lines since the scrollBar of the left side is according to the left side data so I can't scroll down in the right side.
I need to change somehow the proportion of the left scroll bar to be according to the max line size....

Could you please send me an example of this to my email if it works for you ?

doren@watchfire.com


thanks

[Modified at 11/20/2006 12:37 AM]

Dan Oren

Posted 13 years ago by Dan Oren - Software Developer, Watchfire
Avatar
Hey,

Does someone has an answer for this ?
Hwo can I make two syntax editors side by side (like diff application) that controlled by one Vertical ScrollBar for both (Like in 4.0 version DiffForm sample) and dispaly the line numbers hint ?

Dan

Dan Oren

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Our ScrollBar control has ThumbScrolling and ThumbScrolled events. When we do hints, we attach to those and display a tooltip in the ThumbScrolling handler and hide it in the ThumbScrolled handler. Then during the ValueChanged event, we update the tooltip if it is displayed.


Actipro Software Support

Posted 13 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
Hi Dan,

The trick I used was to make both compared documents the same length. This involved inserting blank lines in each document at the appropriate places to make them both have the same number of lines. This kept the scrollbars in sync. I then used custom line numbers for each line in the document to make the line numbers correspond to the original source document.

Boyd
The latest build of this product (v2020.1 build 0400) was released 5 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.