2011-01-21 68 views

回答

1

XAML:

<HyperlinkButton Name="hyperlinkButton" Content="Change Background" MouseEnter="hyperlinkButton_MouseEnter" MouseLeave="hyperlinkButton_MouseLeave" /> 

代碼背後:

private void hyperlinkButton_MouseEnter(object sender, MouseEventArgs e) 
{ 
    hyperlinkButton.Background = new SolidColorBrush(Colors.Red); 
} 

private void hyperlinkButton_MouseLeave(object sender, MouseEventArgs e) 
{ 
    hyperlinkButton.Background = new SolidColorBrush(Colors.White); 
} 
0

Here是視頻教程 「如何風格超鏈接按鈕」。在那裏你可以看到

How to change the color of a Hyperlink Button when the mouse is over it. 

也可以下載源代碼。

如果你想像@BurkDigglers描述的那樣做,那麼你必須爲每個超鏈接按鈕處理MouseEnterMouseLeave事件。