DragDrop Event

Posted by Bubbly under C# category on | Views : 1700
This event fires when the mouse button is released, terminating the drag-and-drop operation.

private void TextBoxLowerRight_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
txtLowerRight.Text = e.Data.GetData(DataFormats.Text).ToString();

// if the Ctrl key was not pressed, remove the source text to effect a
// drag-and-drop move.

if ((e.KeyState & CtrlMask) != CtrlMask)
txtLeft.Text = "";

Comments or Responses

Login to post response