One, form forms style
1.FormBorderStyle
(1) None
(2) FixedSingle
(3) Fixed3D
Personal feeling and fixedsingle are not very different
(4) FixedDialog
You cannot drag the border of a form to adjust the size by using the mouse
(5) sizable
You can drag the border of the form to adjust the size by mouse
(6) Fixedtoolwindow
You cannot drag the border of a form to adjust the size by using the mouse
(7) Sizabletoolwindow
You can drag the border of the form to adjust the size by mouse
2.Name
The form name in the form code.
Public partial class Frmmain:form
{
public Frmmain ()
{
InitializeComponent ();
}
}
3.BackColor, BackgroundImage, BackgroundImageLayout
form background color, picture, picture position settings
4.Icon
form icon Settings
5.Text
Form Display caption Settings
6, StartPosition
The location setting is displayed by default after the form runs.
(1) Manual
Display in the upper-left corner of the screen.
(2) Centerscreen
Appears in the center of the screen.
(3) WindowsDefaultLocation
A position in the upper-left corner.
(4) Windowsdefaultbounds
Windows defaults to a size box.
(5) Centerparent
The center of the parent form.
7.MaxIMizeBox, Minmizebox
Sets whether there is a maximized, minimized box.
8.Opacity
Form Transparency Settings
9.IsMdiContainer
Sets the current form as the form container.
You can create a subform in the Load event of the current form with the following code:
private void Frmmain_load (object sender, EventArgs e)
{
Form2 frm = new Form2 ();
Set the form to open after form mode, with normal, maximized, minimized
frm. MdiParent = this; Key Code
frm. WindowState = Formwindowstate.normal;
Set the form start position
frm. StartPosition = formstartposition.centerparent;
Called in a dialog box
frm. Show ();
}
Ii. Form Events
1.Load Events
Double-click the empty space on the right side of the load in the event to see the following code snippet in the form code of the current form, where you can add the event that the form is loaded in.
private void Frmmain_load (object sender, EventArgs e)
{
}
C # WinForm Controls-Form