G
Gidi
Hi,
I've a winform with no borders, and i still want to let the user the ability
to move the form, since i didn't find any property that allows that, i wrote
the following (simple) code:
private void MainForm_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown == true)
{
this.Location = new System.Drawing.Point(e.X, e.Y);
}
}
private void MainForm_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
isMouseDown = true;
}
}
private void MainForm_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
isMouseDown = false;
}
}
Now, when i move my form, i get it spread on all over the screen until i
release my mouse click.
I know that the answer is somewhere with OnPaint or something like that...
how can i fix that?
Thanks,
Gidi.
I've a winform with no borders, and i still want to let the user the ability
to move the form, since i didn't find any property that allows that, i wrote
the following (simple) code:
private void MainForm_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown == true)
{
this.Location = new System.Drawing.Point(e.X, e.Y);
}
}
private void MainForm_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
isMouseDown = true;
}
}
private void MainForm_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
isMouseDown = false;
}
}
Now, when i move my form, i get it spread on all over the screen until i
release my mouse click.
I know that the answer is somewhere with OnPaint or something like that...
how can i fix that?
Thanks,
Gidi.