Craig
Craig

Reputation: 77

Control Drag Drop

I have a user control in c# on a windows form the drag drop events are only being fired around the edge of the control, does anyone have a clue what is causing this its driving me mad!?

private void flowDiagram1_DragEnter(object sender, DragEventArgs e)
{
  if(e.Data.GetDataPresent(DataFormats.Text))
    e.Effect = DragDropEffects.Move;
  else
    e.Effect = DragDropEffects.None;
}

private void flowDiagram1_DragOver(object sender, DragEventArgs e)
{
  if (!m_bDragging)
    flowDiagram1_DragDrop(sender, e);
}

private void flowDiagram1_DragDrop(object sender, DragEventArgs e)
{
  MessageBox.Show("Drop");
}

Upvotes: 2

Views: 722

Answers (1)

James
James

Reputation: 2911

I think you need to add this to drag over too:

if(e.Data.GetDataPresent(DataFormats.Text))
    e.Effect = DragDropEffects.Move;
  else
    e.Effect = DragDropEffects.None;

Upvotes: 1

Related Questions