我有一個帶背景圖像的按鈕,我想爲此按鈕添加背景色時,我點擊它 這是我如何設置圖像背景按鈕:WPF - 如何設置背景顏色圖像按鈕
XAML:
<Button x:Name="ScannerButton" DockPanel.Dock="Right" Visibility="Collapsed" Click="ScannerButton_Click" Margin="0,0,5,25" Height="70" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="75">
<Button.Template>
<ControlTemplate>
<Image Source="/Resources/scanner.png"></Image>
</ControlTemplate>
</Button.Template>
</Button>
This is how I want it to look like when I click on it
如若背景僅當用戶點擊了'Button'還是應更長的時刻? –
[C#更改按鈕的背景顏色]的可能重複(https://stackoverflow.com/questions/4991041/c-sharp-change-a-buttons-background-color) –
@MightyBadaboom直到我點擊另一個按鈕 – TestMan