C#.net如果添加鼠标移动事件?

来源:百度知道 编辑:UC知道 时间:2024/09/23 21:29:01
我想鼠标移进按钮时响应事件,我该如何添加事件。
是网页的哦,不是C#程序哦

public Form1()
{
InitializeComponent();
this.button1.MouseEnter += new EventHandler(button1_MouseEnter); //这个就是订阅鼠标进入的事件
}

void button1_MouseEnter(object sender, EventArgs e)
{
//在这里写你要做的事
}

//选中控件 在属性那 有个黄个的小闪电 点 找到MouseEnter 在右边空白那双击 然后你就知道了