C # WinForm Controls-Form

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.