Make the horizontal scroll bar always visible

SyntaxEditor for WPF Forum

Posted 3 years ago by Sunshine - Appeon
Version: 21.1.2
Avatar

I set SyntaxEditor.HorizontalScrollBarVisibility to Visable, but it does not always display the horizontal scroll bar as expected.

Comments (4)

Posted 3 years ago by Sunshine - Appeon
Avatar

This happens only when WordWrapMode is set to Word

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

Hello,

That is by design.  The horizontal scrollbar won't show if word wrap is active because the scrollbar can never be enabled in that scenario, and is just taking up space.


Actipro Software Support

Posted 3 years ago by Sunshine - Appeon
Avatar

But in the case of automatic line wrapping, the contents of ScrollBarTrayLeftTemplate and ScrollBarTrayRightTemplate need to be displayed.

So now we can display some of the content we added to the left and right of the horizontal scroll bar, but the horizontal scroll bar is not displayed.

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

Ahh I see... yes you would need the existing behavior altered to keep the scrollbar tray content visible.  We will update this for the next build with these notes:

  • Added the SyntaxEditor.WordWrapModeChanged event that is raised when the SyntaxEditor.WordWrapMode property is changed.
  • Updated the horizontal ScrollBar to remain visible in word wrap mode when the SyntaxEditor.HorizontalScrollBarVisibility property is Visible (the default), which matches Visual Studio behavior. This ensures any horizontal ScrollBar tray content can remain visible in word wrap mode. Use the new WordWrapModeChanged event to alter the HorizontalScrollBarVisibility property as needed if you still wish the horizontal ScrollBar to be hidden when word wrapping.


Actipro Software Support

The latest build of this product (v24.1.1) 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.