1, the Realization form full screen display
Method: Do the following in a Full-screen method
This. FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
This. WindowState = System.Windows.Forms.FormWindowState.Maximized;
2. Realize the full screen display of a control in the window body
Method: For example, to display the RichTextBox control in full screen, as follows (this is the current form)
This. FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
This. windowstate=formwindowstate.maximized;
Rectangle ret = Screen.getworkingarea (this);
This.richTextBox2.ClientSize = new Size (ret. Width, ret. Height);
This.richTextBox2.Dock = DockStyle.Fill;
This.richTextBox2.BringToFront ();
3, exit full screen, restore original appearance
Method: The prerequisite is to define a class member variable to hold the original size (size) of the control you want to Full-screen, and then initialize it within the constructor to the control's original size
In the exit Full-screen method, the following actions
This. FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
This. WindowState = Formwindowstate.normal;
This.richTextBox2.ClientSize = Primarysize;//primarysize is the original size of the control
This.richTextBox2.Dock = Dockstyle.none;