我已经编写了此代码,用于将文本插入到Button中。所以我有这样的:WPF如何在鼠标位于按钮上时更改背景图片
<Button Style="{StaticResource TransparentButton}"
Grid.Column="0"
Grid.Row="0"
Command="{Binding Path=MovePreviousCommand}"
Width="150">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Grid>
<Image Source="./Resources/Images/bottone_indietro.png" Width="130"/>
<Label Content="{x:Static res:Strings.GestoreWizardView_Button_MovePrevious}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="48,10,26,8" Style="{StaticResource LabelStyleButton}"
/>
</Grid>
</StackPanel>
</Button.Content>
</Button>
这是一个样式按钮
<Style TargetType="Button" x:Key="TransparentButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="Transparent">
<ContentPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
现在我想改变背景图像时,鼠标移动到按钮。
我们可以帮我吗?
最好的调节器。
它是按钮或整个窗口的背景吗? – ZoomVirus 2014-09-24 14:53:05
是按钮 – bircastri 2014-09-24 14:53:48