Hi
You have to write below 3 mouse events to move the label control at runtime
private Boolean dragInProgress = false;
int MouseDownX = 0;
int MouseDownY = 0;
private void label1_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.dragInProgress = false;
}
return;
}
private void label1_MouseDown(object sender, MouseEventArgs e)
{
if (!this.dragInProgress)
{
this.dragInProgress = true;
this.MouseDownX = e.X;
this.MouseDownY = e.Y;
}
return;
}
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (dragInProgress)
{
Point temp = new Point();
temp.X = this.label1.Location.X + (e.X - MouseDownX);
temp.Y = this.label1.Location.Y + (e.Y - MouseDownY);
this.label1.Location = temp;
}
return;
}