Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
Add a new feature
Browse files Browse the repository at this point in the history
* The widget will move to your desired location when you drag and drop it.
  • Loading branch information
Serena1432 committed Sep 8, 2022
1 parent f5a08f7 commit ce8b22a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,5 +455,34 @@ private void timer3_Tick(object sender, EventArgs e)
}
}
}

void HandleMouseDown(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
HandleMouseDown(e);
}

private void label1_MouseDown(object sender, MouseEventArgs e)
{
HandleMouseDown(e);
}

private void label2_MouseDown(object sender, MouseEventArgs e)
{
HandleMouseDown(e);
}

private void tableLayoutPanel1_MouseDown(object sender, MouseEventArgs e)
{
HandleMouseDown(e);
}
}
}

0 comments on commit ce8b22a

Please sign in to comment.