After you have changed the FormBorderStyle to None, there is a question standing against you: "How to move such a kind of window?"
The solution is easy as follows:
bool dragging;
Point offset;
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
dragging = true;
offset = e.Location;
}
private void Form1_MouseUp(object sender, MouseEventArgs e)
{
dragging = false;
}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (dragging)
{
Point currentScreenPos = PointToScreen(e.Location);
Location = new
Point (currentScreenPos.X - offset.X,
currentScreenPos.Y - offset.Y);
}
}
Subscribe to:
Post Comments (Atom)
try this
ReplyDeletehttp://bytes.com/topic/c-sharp/answers/891062-moving-form-without-title-bar
thanks!
ReplyDelete