Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting ScrollBar bar size?

I'm creating a scrollbar in codebehind like so:

     ScrollBar b = new ScrollBar();
     Grid ScrollbarGrid = GetTemplateChild( "ScrollbarGrid" ) as Grid;
     b.Orientation = Orientation.Horizontal;
     ScrollbarGrid.Children.Add(b);

What I need is for the scrollbar handle to be of a size I set myself if that is at all possible?

like image 661
meds Avatar asked May 29 '26 23:05

meds


1 Answers

You can use ViewportSize

like b.ViewportSize = 5;

take a look at here for more information.

and MSDN's Track Class how thumb size calculates

like image 117
Navid Rahmani Avatar answered Jun 01 '26 11:06

Navid Rahmani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!