示例#1
0
 private void control_MouseDown(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         pnControls.Invalidate();
         SelectedControl = (Control)sender;
         var control = (Control)sender;
         mouseX = (int)-e.GetPosition(e.Device.Target).X;
         mouseY = (int)-e.GetPosition(e.Device.Target).Y;
         control.Invalidate();
         DrawControlBorder(control);
     }
 }
        private void OnMouseMoveD3D(object sender, System.Windows.Input.MouseEventArgs e)
        {
            int deltaX = (int)((int)e.GetPosition(this).X - _lastMousePositionX);
            int deltaY = (int)((int)e.GetPosition(this).Y - _lastMousePositionY);

            _controller.MouseMove((int)e.GetPosition(this).X, (int)e.GetPosition(this).Y, deltaX, deltaY);
            _lastMousePositionX = (int)e.GetPosition(this).X;
            _lastMousePositionY = (int)e.GetPosition(this).Y;
        }