DragEnter Event
DragEnter is the event that fires when an object is dragged into the control's bounds. Here is an example code to show how DragEnter event works.
private void TextBoxLowerRight_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
{
// Check to be sure that the drag content is the correct type for this
// control. if not, reject the drop.
if (e.Data.GetDataPresent(DataFormats.Text))
{
// if the Ctrl key was pressed during the drag operation then perform
// a Copy. if not, perform a Move.
if ((e.KeyState & CtrlMask) == CtrlMask)
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.Move;
}
}
else
{
e.Effect = DragDropEffects.None;
}
}