标签:resource width height and 程序 component smo over image
1:image button样式
<Style x:Key="Button.File" TargetType="Button">
              <Setter Property="Cursor" Value="Hand"></Setter>
              <Setter Property="Template" >
                    <Setter.Value>
                          <ControlTemplate TargetType="Button">
                                <Image Name="FileImage" Source="/程序集名称;component/images/file.png"/>
                                <ControlTemplate.Triggers>
                                      <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="FileImage" Property="Source" Value="/程序集名称;component/images/file_over.png"/>
                                      </Trigger>
                                </ControlTemplate.Triggers>
                          </ControlTemplate>
                    </Setter.Value>
              </Setter>
        </Style>
2:使用image button样式
<Button Style="{StaticResource Button.File}" Height="30" Width="30" VerticalAlignment="Center" HorizontalAlignment="Center"></Button>
标签:resource width height and 程序 component smo over image
原文地址:http://www.cnblogs.com/by-lhc/p/7207306.html