Set ScrollBar Width and Height

SyntaxEditor for WPF Forum

Posted 2 years ago by Rory Mathers
Version: 22.1.1
Avatar

Hi,

is it possible to set the width of the vertical scrollbar and the height of the horizontal scrollbar used by the editor?

Kind Regards, Rory Mathers

Comments (4)

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

Hi Rory,

The ScrollBars current measure to their default width/height from their control template.  You could probably make an implicit Style that targets ScrollBar in the SyntaxEditor.Resources and set a MinWidth or MinHeight there if you'd like to increase it.


Actipro Software Support

Posted 2 years ago by Rory Mathers
Avatar

Hi,

Sorry I should have specified. I am trying to make them smaller in size. I have tried what you suggested by using MaxWidth and MaxHeight, however the size cannot be reduced, this seems to be the case when using ScrollViewers generally.

I have also tried setting the ScrollViewer template using an implicit Style under the SyntaxEditor.Resources but it is not applied to the control. I'm assuming this is due to either an internal control being used or an explicit style being set.

Kind Regards, Rory Mathers

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

Hi Rory,

Making them smaller might be an issue because our Panel-based control that arranges the column for the vertical scrollbar and any surrounding scrollbar trays uses a minimum width of SystemParameters.ScrollWidth.  Likewise it arranges the row for the horizontal scrollbar and any surrounding scrollbar trays with a minimum height of SystemParameters.ScrollHeight.  While you can make the column/row larger, they won't go smaller than those extents.

Also, we don't use a ScrollViewer in the SyntaxEditor control.  It creates two distinct ScrollBar controls and I don't believe their Styles are explicitly set, so implicit Styles targing ScrollBar should flow into them.


Actipro Software Support

Posted 2 years ago by Rory Mathers
Avatar

Hi,

Thanks for the quick replies. I have tried again with the implicit ScrollBar style, this time setting both the Min and the Max values for the Width and Height, and am able to make the ScrollBars smaller.

Kind Regards, Rory Mathers

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.