Code
<Ellipse Canvas.Left="30" MouseMove="Ellipse_MouseMove"
MouseEnter="Ellipse_MouseEnter"
MouseLeave="Ellipse_MouseLeave"
Canvas.Top="50" Width="80" Height="80" Fill="Brown">
</Ellipse>
Code
private void Elipse_MouseEnter(object sender, MouseEventArgs e)
{
Ellipse ell = sender as Ellipse;
ell.Fill = new SolidColorBrush(Colors.Magenta);
}
private void Elipse_MouseLeave(object sender, MouseEventArgs e)
{
Ellipse ell = sender as Ellipse;
ell.Fill = new SolidColorBrush(Colors.Orange);
}
在后台加载事件
Code
public Page()
{
InitializeComponent();
MyEllipse.MouseEnter += new MouseEventHandler(MyEllipse_MouseEnter);
MyEllipse.MouseLeave +=new MouseEventHandler(MyEllipse_MouseLeave);
}
顺我者昌,逆我者亡.
posted on
2009-10-10 14:27
流氓宝宝
阅读(
276)
评论()
编辑
收藏
举报