I'm trying to build a form where the user can drag a label and drop it on a text box. I can find an AllowDrop in the text box, but there is no property such as "AllowDrag" in the label. Also, I created methods for all the drag & drop events for the label (DragEnter, DragLeave, etc) but none of them seem to work. I can not figure out how to drag. How do I handle it?
private void label1_Click(object sender, EventArgs e)
{
// This one works
status.Text = "Click";
}
private void label1_DragOver(object sender, DragEventArgs e)
{
// this and the others do not
status.Text = "DragOver";
}
private void label1_GiveFeedback(object sender, GiveFeedbackEventArgs e)
{
status.Text = "GiveFeedback";
}
private void label1_DragDrop(object sender, DragEventArgs e)
{
status.Text = "DragDrop";
}
private void label1_DragEnter(object sender, DragEventArgs e)
{
status.Text = "DragEnter";
}
private void label1_DragLeave(object sender, EventArgs e)
{
status.Text = "DragLeave";
}
private void label1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
status.Text = "QueryContinueDrag";
}