1. Form default Full-screen _load event Add:
This. WindowState = formwindowstate.maximized;
2. Set the specific location where the form appears
Forms form = new form ();
Form. StartPosition = formstartposition.manual;
Form. Location = new Point (0);
Form. Show ();
3. Prevent WinForm form Moving : When the form is loaded, record the position of the form, and when the form is moved, assign the previous value to it so that it does not move.
In the process of dragging the mouse, there is still a frame of the form moving along with it. Use the message mechanism to implement. In that case, there would be no such phenomenon.
#region prevent forms from moving public
const int wm_syscommand = 0x112;
public const int sc_move = 0xf012;
protected override void WndProc (ref message m)
{
if (m.msg = = Wm_syscommand)
{if (
(int) m. WParam = = Sc_move) return
;
Base. WndProc (ref m);
}
#endregion