1

I am creating a form which has no borders, but I want the user to be able to move it on clicking a button (the form is not locked).

How could I do it C#?

This is the "Move" I am talking about :

Move

Junaith
  • 3,298
  • 24
  • 34
Ahmed A.M
  • 55
  • 1
  • 3
  • You can find your answer on this link[ Here][1] [1]: http://stackoverflow.com/questions/1592876/c-sharp-make-a-borderless-form-movable – Waqas Shabbir Feb 10 '14 at 15:49

2 Answers2

0

The easiest way is "to say" to Windows that all form is a CAPTION.

  • good: it's easy and works as you cheat OS, so it behaves blindly.

  • bad: consider, for example, that making a double-click on your window will lead to maximize.

Other way is: track ouse down point, and mousemove and move your form accordingly.

All possible examples can find on post searching for:

Winforms - Click/drag anywhere in the form to move it as if clicked in the form caption, or following link provided in comments.

Tigran
  • 61,654
  • 8
  • 86
  • 123
0

have you tried to call Win API SendMessage?

SendMessage(SYS_COMMAND, SC_MOVE);
mnieto
  • 3,744
  • 4
  • 21
  • 37