自定义Button实现屏蔽鼠标单击和双击

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace TestMyControls
{
    class MyButton : Button
    {
        private const int WM_LBUTTONDOWN = 0x201;
        private const int WM_LBUTTONDBLCLK = 0x203;
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == WM_LBUTTONDOWN || m.Msg == WM_LBUTTONDBLCLK)
            {
                return;
            }
            base.WndProc(ref m);
        }
 
    }
}
posted @ 2013-04-15 19:16  Predator  阅读(452)  评论(0编辑  收藏  举报