Ejemplo n.º 1
0
        public Form1()
        {
            //A
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            MouseHelper mh = new MouseHelper(this);

            mh.AddControl(pictureBox1);
            mh.LeftMouseDown   += new MouseEventHandler(OnLeftMouseDown);
            mh.LeftMouseUp     += new MouseEventHandler(OnLeftMouseUp);
            mh.RightMouseDown  += new MouseEventHandler(OnRightMouseDown);
            mh.RightMouseUp    += new MouseEventHandler(OnRightMouseUp);
            mh.MiddleMouseDown += new MouseEventHandler(OnMiddleMouseDown);
            mh.MiddleMouseUp   += new MouseEventHandler(OnMiddleMouseUp);
            mh.WheelForward    += new MouseEventHandler(OnWheelForward);
            mh.WheelBackward   += new MouseEventHandler(OnWheelBackward);
        }