我已經編寫了此代碼,用於將文本插入到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