Form Constructor
Collapse the table of content
Expand the table of content

Form Constructor ()


Initializes a new instance of the Form class.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

new : unit -> Form

The default size of a form is 300 pixels in height and 300 pixels in width.

The following code example creates a new instance of a Form and calls the ShowDialog method to display the form as a dialog box. The example sets the FormBorderStyle, AcceptButton, CancelButton, MinimizeBox, MaximizeBox, and StartPosition properties to change the appearance and functionality of the form to a dialog box. The example also sets uses the Add method of the form's Controls collection to add two Button controls. The example uses the HelpButton property to display a help button in the caption bar of the dialog box.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft