예제 #1
0
 /// <summary>
 ///     Handle the mouse up on the Pipette "label", we release the capture and fire the PipetteUsed event
 /// </summary>
 /// <param name="e">MouseEventArgs</param>
 protected override void OnMouseUp(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         //Release Capture should consume MouseUp when canceled with the escape key
         User32Api.ReleaseCapture();
         PipetteUsed?.Invoke(this, new PipetteUsedArgs(_movableShowColorForm.ColorUnderCursor));
     }
     base.OnMouseUp(e);
 }
예제 #2
0
 public bool PreFilterMessage(ref Message m)
 {
     if (_dragging)
     {
         if (m.Msg == (int)WindowsMessages.WM_CHAR)
         {
             if ((int)m.WParam == VkEsc)
             {
                 User32Api.ReleaseCapture();
             }
         }
     }
     return(false);
 }