2
有没有人看到一个良好的Office 2007样式缩放滑块模板?寻找一个Office 2007风格的缩放滑块模板
正如这张照片 alt text http://www.theexceladdict.com/images/zoom_controls_excel_2007_2003.jpg
有没有人看到一个良好的Office 2007样式缩放滑块模板?寻找一个Office 2007风格的缩放滑块模板
正如这张照片 alt text http://www.theexceladdict.com/images/zoom_controls_excel_2007_2003.jpg
像这样的事情会很容易地创建出。
首先创建一个按钮样式:
<Style x:Key="ZoomIncreaseDecreaseStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Grid>
<Ellipse Stroke="Gray" x:Name="Ellipse">
<Ellipse.Fill>
<RadialGradientBrush ... />
</Ellipse.Fill>
</Ellipse>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
<ControlTemplate.Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Ellipse" Property="Fill">
<RadialGradientBrush ... />
</Setter>
</Trigger>
</ControlTemplate.Trigger>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style>
然后修改控件模板在Blend(创建副本),并添加像这样围绕<网>:
<DockPanel>
<RepeatButton
DockPanel.Dock="Left"
Command="{x:Stastic Slider.DecreaseLarge}"
ControlTemplate="{StaticResource ZoomIncreaseDecreaseStyle}">
<Path Data="{StaticResource MinusGeometry}" />
</RepeatButton>
<RepeatButton
DockPanel.Dock="Right"
Command="{x:Stastic Slider.IncreaseLarge}"
ControlTemplate="{StaticResource ZoomIncreaseDecreaseStyle}">
<Path Data="{StaticResource PlusGeometry}" />
</RepeatButton>
<Grid>
...
你可以玩按钮描边颜色,渐变填充以及+和 - 路径以按照您的需要进行设置。我认为实际的Office 2007按钮受版权保护,因此您可能无法在不侵犯版权的情况下将其复制得过密。但是这会让你看起来非常相似。
你在说这件事吗? http://www.theexceladdict.com/images/zoom_controls_excel_2007_2003.jpg – 2009-11-03 02:10:45
是的,正好!感谢您的形象 – 2009-11-03 02:25:56