Tony
Tony

Reputation: 12695

A problem with a ListBox's template

I changed the template of the ListBox. The problem is, look at the vertical Scrollbar: http://img223.imageshack.us/img223/3391/lisbox.jpg

how to make it lie within ths rounded ListBox ?

Upvotes: 0

Views: 218

Answers (1)

Simeon Pilgrim
Simeon Pilgrim

Reputation: 25903

If your wanting the scrollbar more left

make it lie within ths rounded ListBox

Then add a margin to your ScrollViewer section of the ListBox template like this:

<ScrollViewer Focusable="false"  Margin="0,0,20,0">
    <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>

If you want the background of the ScrollViewer to match the ListBox background you'll need to replace the Style template for this also.

<ScrollViewer Focusable="false"  Template="{DynamicResource ScrollViewerControlTemplate1}" >
    <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>

Upvotes: 1

Related Questions