2009/06/02(Tue) 21:27:27 編集(投稿者)
<pre><pre><Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<ControlTemplate x:Key="test" TargetType="{x:Type ScrollBar}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="12" />
<RowDefinition Height="*"/>
<RowDefinition Height="12" />
</Grid.RowDefinitions>
<Border Grid.Row="1" BorderThickness="0"
Background="Transparent" CornerRadius="4"/>
<RepeatButton Grid.Row="0"
Style="{DynamicResource Scrollbar_LineButton}"
Command="ScrollBar.LineDownCommand" Content=" ^" />
<!--IsDirectionReversed set to true draws a ScrollBar with a
Track whose lowest value is at the bottom.
The default orientation of a ScrollBar is for the Track
values to decrease from top to bottom.-->
<Track Grid.Row="1" Name="PART_Track"
IsDirectionReversed="false">
<Track.DecreaseRepeatButton>
<RepeatButton Style="{DynamicResource ScrollBar_UpTrack}"/>
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{DynamicResource ScrollBar_HorizontalThumb}"/>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Style="{DynamicResource ScrollBar_DownTrack}"/>
</Track.IncreaseRepeatButton>
</Track>
<RepeatButton Grid.Row="2"
Style="{DynamicResource Scrollbar_LineButton}"
Command="ScrollBar.LineUpCommand" Content=" v" />
</Grid>
</ControlTemplate>
</Window.Resources>
<Grid>
<TextBlock Height="21" Margin="15,34,0,0" Name="textBlock1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="120" />
<ScrollBar HorizontalAlignment="Right" Margin="0,74,63,88" Name="scrollBar1" Width="18" ValueChanged="scrollBar1_ValueChanged_1" Template="{StaticResource test }" />
</Grid>
</Window>
なんか、それらしき物が出来ました。
よし、完成。ブログのネタにしよう!