<Style x:Key="mylists" TargetType="{x:Type ListBox}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> <Setter Property="MinWidth" Value="120"/> <Setter Property="MinHeight" Value="95"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBox}"> <Border x:Name="bd" Background="White"> <ScrollViewer Margin="0" Focusable="false" > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="80*" /> <ColumnDefinition Width="Auto" MinWidth="{TemplateBinding MinWidth}"/> </Grid.ColumnDefinitions> <StackPanel Margin="2" IsItemsHost="True"> </StackPanel> <ScrollBar Orientation="Vertical" Margin="0,0" HorizontalAlignment="Right" Grid.Column="1"> <ScrollBar.Template> <ControlTemplate> <Track x:Name="PART_Track"> <Track.DecreaseRepeatButton> <RepeatButton Background="{x:Null}"/> </Track.DecreaseRepeatButton> <Track.IncreaseRepeatButton> <RepeatButton Background="{x:Null}" /> </Track.IncreaseRepeatButton> <Track.Thumb> <Thumb Background="Gray" /> </Track.Thumb> </Track> </ControlTemplate> </ScrollBar.Template> </ScrollBar> </Grid> </ScrollViewer> </Border> <ControlTemplate.Triggers> <Trigger Property="IsGrouping" Value="true"> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)