meds
meds

Reputation: 22926

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?

Upvotes: 3

Views: 2044

Answers (2)

Navid Rahmani
Navid Rahmani

Reputation: 7958

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

Upvotes: 3

Chen Kinnrot
Chen Kinnrot

Reputation: 21015

You can set the Height and Width property of the scroll bar, is this what you need ?

Upvotes: 0

Related Questions