Winform 控件添加事件

Winform 控件添加事件
        /// <summary>
        /// 添加按钮上鼠标 移入、移出、按下、弹起 事件
        /// </summary>
        /// <param name="btn">操作的按钮</param>
        private void AddBtnEvent(Button btn)
        {
            btn.MouseEnter += delegate (object sender, EventArgs e)
            {
                ((Button)sender).BackgroundImage = Resources.btnMouseEnter;
            };
            btn.MouseLeave += delegate (object sender, EventArgs e)
            {
                ((Button)sender).BackgroundImage = Resources.btnMouseLeave;
            };
            btn.MouseDown += delegate (object sender, MouseEventArgs e)
            {
                ((Button)sender).BackgroundImage = Resources.btnMouseDown
            };
            btn.MouseUp += delegate (object sender, MouseEventArgs e)
            {
                ((Button)sender).BackgroundImage = Resources.btnMouseUp;
            };
        }

作者最新文章
css 去掉a标签超链接的虚线框的方法, 何去除超链接点击时的虚线?
C# 创建、保存、写入无 bom 的 utf-8 编码文件
ASP.NET aspx 后台代码执行前台js脚本, 弹出消息, 调用函数
ASP.NET aspx 后台代码控制前台显示、隐藏
js 打印功能