ClearCanvas.Desktop.View.WinForms.DataGridViewWithDragSupport.HandleRightMouseDown(System.Windows.Forms.MouseEventArgs)

Here are the examples of the csharp api class ClearCanvas.Desktop.View.WinForms.DataGridViewWithDragSupport.HandleRightMouseDown(System.Windows.Forms.MouseEventArgs) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: ClearCanvas
Source File: DataGridViewWithDragSupport.cs
protected override void OnMouseDown(MouseEventArgs e)
		{
			// get the index of the clicked item
			_rowIndexFromMouseDown = HitTest(e.X, e.Y).RowIndex;

			// basic mouse handling has right clicks show context menu without changing selection, so we handle it manually here
			if (e.Button == MouseButtons.Right)
				HandleRightMouseDown(e);

			// call the base class, so that the row gets selected, etc.
			base.OnMouseDown(e);

			if (_rowIndexFromMouseDown > -1)
			{
				// Remember the point where the mouse down occurred. 
				// The DragSize indicates the size that the mouse can move 
				// before a drag event should be started.                
				Size dragSize = SystemInformation.DragSize;

				// Create a rectangle using the DragSize, with the mouse position being
				// at the center of the rectangle.
				_dragBoxFromMouseDown = new Rectangle(new Point(e.X - (dragSize.Width/2), e.Y - (dragSize.Height/2)), dragSize);
			}
			else
			{
				// Reset the rectangle if the mouse is not over an item in the ListBox.
				_dragBoxFromMouseDown = Rectangle.Empty;
			}
		}