System.Windows.Forms.Form Members

The members of System.Windows.Forms.Form are listed below.

See Also: Inherited members from System.Windows.Forms.ContainerControl

Public Constructors

Initializes a new instance of the System.Windows.Forms.Form class.

Public Properties

AcceptButtonSystem.Windows.Forms.IButtonControl.

Gets or sets the button on the form that is clicked when the user presses the ENTER key.

[read-only]
static
ActiveFormSystem.Windows.Forms.Form.

Gets the currently active form for this application.

[read-only]
ActiveMdiChildSystem.Windows.Forms.Form.

Gets the currently active multiple-document interface (MDI) child window.

AllowTransparencybool.

Gets or sets a value indicating whether the opacity of the form can be adjusted.

AutoScalebool.

Gets or sets a value indicating whether the form adjusts its size to fit the height of the font used on the form and scales its controls.

AutoScaleBaseSizeSystem.Drawing.Size.

Gets or sets the base size used for autoscaling of the form.

override
AutoScrollbool.

Gets or sets a value indicating whether the form enables autoscrolling.

override
AutoSizebool.

Resize the form according to the setting of Form.AutoSizeMode.

AutoSizeModeSystem.Windows.Forms.AutoSizeMode.

Gets or sets the mode by which the form automatically resizes itself.

override
AutoValidateSystem.Windows.Forms.AutoValidate. Documentation for this section has not yet been entered.
override
BackColorSystem.Drawing.Color. Documentation for this section has not yet been entered.
CancelButtonSystem.Windows.Forms.IButtonControl.

Gets or sets the button control that is clicked when the user presses the ESC key.

ClientSizeSystem.Drawing.Size.

Gets or sets the size of the client area of the form.

ControlBoxbool.

Gets or sets a value indicating whether a control box is displayed in the caption bar of the form.

DesktopBoundsSystem.Drawing.Rectangle.

Gets or sets the size and location of the form on the Windows desktop.

DesktopLocationSystem.Drawing.Point.

Gets or sets the location of the form on the Windows desktop.

DialogResultSystem.Windows.Forms.DialogResult.

Gets or sets the dialog result for the form.

FormBorderStyleSystem.Windows.Forms.FormBorderStyle.

Gets or sets the border style of the form.

HelpButtonbool.

Gets or sets a value indicating whether a Help button should be displayed in the caption box of the form.

IconSystem.Drawing.Icon.

Gets or sets the icon for the form.

[read-only]
IsMdiChildbool.

Gets a value indicating whether the form is a multiple-document interface (MDI) child form.

IsMdiContainerbool.

Gets or sets a value indicating whether the form is a container for multiple-document interface (MDI) child forms.

[read-only]
IsRestrictedWindowbool.

Gets a value indicating whether the form can use all windows and user input events without restriction.

KeyPreviewbool.

Gets or sets a value indicating whether the form will receive key events before the event is passed to the control that has focus.

LocationSystem.Drawing.Point.

Gets or sets the System.Drawing.Point that represents the upper-left corner of the System.Windows.Forms.Form in screen coordinates.

MainMenuStripSystem.Windows.Forms.MenuStrip.

Gets or sets the primary menu container for the form.

MarginSystem.Windows.Forms.Padding.

Gets or sets the space between controls.

MaximizeBoxbool.

Gets or sets a value indicating whether the Maximize button is displayed in the caption bar of the form.

override
MaximumSizeSystem.Drawing.Size.

Gets the maximum size the form can be resized to.

[read-only]
MdiChildrenSystem.Windows.Forms.Form[].

Gets an array of forms that represent the multiple-document interface (MDI) child forms that are parented to this form.

MdiParentSystem.Windows.Forms.Form.

Gets or sets the current multiple-document interface (MDI) parent form of this form.

MenuSystem.Windows.Forms.MainMenu.

Gets or sets the System.Windows.Forms.MainMenu that is displayed in the form.

[read-only]
MergedMenuSystem.Windows.Forms.MainMenu.

Gets the merged menu for the form.

MinimizeBoxbool.

Gets or sets a value indicating whether the Minimize button is displayed in the caption bar of the form.

override
MinimumSizeSystem.Drawing.Size.

Gets or sets the minimum size the form can be resized to.

[read-only]
Modalbool.

Gets a value indicating whether this form is displayed modally.

Opacitydouble.

Gets or sets the opacity level of the form.

[read-only]
OwnedFormsSystem.Windows.Forms.Form[].

Gets an array of System.Windows.Forms.Form objects that represent all forms that are owned by this form.

OwnerSystem.Windows.Forms.Form.

Gets or sets the form that owns this form.

[read-only]
RestoreBoundsSystem.Drawing.Rectangle.

Gets the location and size of the form in its normal window state.

RightToLeftLayoutbool.

Gets or sets a value indicating whether right-to-left mirror placement is turned on.

ShowIconbool.

Gets or sets a value indicating whether an icon is displayed in the caption bar of the form.

ShowInTaskbarbool.

Gets or sets a value indicating whether the form is displayed in the Windows taskbar.

SizeSystem.Drawing.Size.

Gets or sets the size of the form.

SizeGripStyleSystem.Windows.Forms.SizeGripStyle.

Gets or sets the style of the size grip to display in the lower-right corner of the form.

StartPositionSystem.Windows.Forms.FormStartPosition.

Gets or sets the starting position of the form at run time.

TabIndexint.

Gets or sets the tab order of the control within its container.

TabStopbool.

Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.

override
Textstring. Documentation for this section has not yet been entered.
TopLevelbool.

Gets or sets a value indicating whether to display the form as a top-level window.

TopMostbool.

Gets or sets a value indicating whether the form should be displayed as a topmost form.

TransparencyKeySystem.Drawing.Color.

Gets or sets the color that will represent transparent areas of the form.

WindowStateSystem.Windows.Forms.FormWindowState.

Gets or sets a value that indicates whether form is minimized, maximized, or normal.

Protected Properties

[read-only]
override
CreateParamsSystem.Windows.Forms.CreateParams. Documentation for this section has not yet been entered.
[read-only]
override
DefaultImeModeSystem.Windows.Forms.ImeMode.

Gets the default Input Method Editor (IME) mode supported by the control.

[read-only]
override
DefaultSizeSystem.Drawing.Size. Documentation for this section has not yet been entered.
MaximizedBoundsSystem.Drawing.Rectangle.

Gets and sets the size of the form when it is maximized.

[read-only]
ShowWithoutActivationbool.

Gets a value indicating whether the window will be activated when it is shown.

Public Methods

Activate()

Activates the form and gives it focus.

AddOwnedForm(System.Windows.Forms.Form)

Adds an owned form to this form.

Close()

Closes the form.

static
GetAutoScaleSize(System.Drawing.Font) : System.Drawing.SizeF

Gets the size when autoscaling the form based on a specified font.

LayoutMdi(System.Windows.Forms.MdiLayout)

Arranges the multiple-document interface (MDI) child forms within the MDI parent form.

RemoveOwnedForm(System.Windows.Forms.Form)

Removes an owned form from this form.

SetDesktopBounds(int, int, int, int)

Sets the bounds of the form in desktop coordinates.

SetDesktopLocation(int, int)

Sets the location of the form in desktop coordinates.

Show(System.Windows.Forms.IWin32Window)

Shows the form with the specified owner to the user.

ShowDialog() : System.Windows.Forms.DialogResult

Shows the form as a modal dialog box.

ShowDialog(System.Windows.Forms.IWin32Window) : System.Windows.Forms.DialogResult

Shows the form as a modal dialog box with the specified owner.

override
ToString() : string

Gets a string representing the current instance of the form.

override
ValidateChildren() : bool
Documentation for this section has not yet been entered.
override
ValidateChildren(System.Windows.Forms.ValidationConstraints) : bool
Documentation for this section has not yet been entered.

Protected Methods

ActivateMdiChild(System.Windows.Forms.Form)

Activates the MDI child of a form.

override
AdjustFormScrollbars(bool)

Adjusts the scroll bars on the container based on the current control positions and the control currently selected.

ApplyAutoScaling()

Resizes the form according to the current value of the Form.AutoScaleBaseSize property and the size of the current font.

CenterToParent()

Centers the position of the form within the bounds of the parent form.

CenterToScreen()

Centers the form on the current screen.

override
CreateControlsInstance() : System.Windows.Forms.Control.ControlCollection
Documentation for this section has not yet been entered.
override
CreateHandle()

Creates the handle for the form. If a derived class overrides this function, it must call the base implementation.

override
DefWndProc(ref System.Windows.Forms.Message)
Documentation for this section has not yet been entered.
override
Dispose(bool)

Disposes of the resources (other than memory) used by the System.Windows.Forms.Form.

override
GetScaledBounds(System.Drawing.Rectangle, System.Drawing.SizeF, System.Windows.Forms.BoundsSpecified) : System.Drawing.Rectangle
Documentation for this section has not yet been entered.
OnActivated(EventArgs)

Raises the Form.Activated event.

override
OnBackgroundImageChanged(EventArgs)

Raises the Control.BackgroundImageChanged event.

override
OnBackgroundImageLayoutChanged(EventArgs)

Raises the Control.BackgroundImageLayoutChanged event.

OnClosed(EventArgs)

Raises the Form.Closed event.

OnClosing(System.ComponentModel.CancelEventArgs)

Raises the Form.Closing event.

override
OnCreateControl()

Raises the CreateControl event.

OnDeactivate(EventArgs)

Raises the Form.Deactivate event.

override
OnEnabledChanged(EventArgs)
Documentation for this section has not yet been entered.
override
OnEnter(EventArgs)

Raises the Control.Enter event.

override
OnFontChanged(EventArgs)
Documentation for this section has not yet been entered.
OnFormClosed(System.Windows.Forms.FormClosedEventArgs)

Raises the Form.FormClosed event.

OnFormClosing(System.Windows.Forms.FormClosingEventArgs)

Raises the Form.FormClosing event.

override
OnHandleCreated(EventArgs)
Documentation for this section has not yet been entered.
override
OnHandleDestroyed(EventArgs)
Documentation for this section has not yet been entered.
OnHelpButtonClicked(System.ComponentModel.CancelEventArgs)

Raises the Form.HelpButtonClicked event.

OnInputLanguageChanged(System.Windows.Forms.InputLanguageChangedEventArgs)

Raises the Form.InputLanguageChanged event.

OnInputLanguageChanging(System.Windows.Forms.InputLanguageChangingEventArgs)

Raises the Form.InputLanguageChanging event.

override
OnLayout(System.Windows.Forms.LayoutEventArgs)

Raises the Control.Layout event.

OnLoad(EventArgs)

Raises the Form.Load event.

OnMaximizedBoundsChanged(EventArgs)

Raises the Form.MaximizedBoundsChanged event.

OnMaximumSizeChanged(EventArgs)

Raises the Form.MaximumSizeChanged event.

OnMdiChildActivate(EventArgs)

Raises the Form.MdiChildActivate event.

OnMenuComplete(EventArgs)

Raises the Form.MenuComplete event.

OnMenuStart(EventArgs)

Raises the Form.MenuStart event.

OnMinimumSizeChanged(EventArgs)

Raises the Form.MinimumSizeChanged event.

override
OnPaint(System.Windows.Forms.PaintEventArgs)
Documentation for this section has not yet been entered.
override
OnResize(EventArgs)
Documentation for this section has not yet been entered.
OnResizeBegin(EventArgs)

Raises the Form.ResizeBegin event.

OnResizeEnd(EventArgs)

Raises the Form.ResizeEnd event.

OnRightToLeftLayoutChanged(EventArgs)

Raises the Form.RightToLeftLayoutChanged event.

OnShown(EventArgs)

Raises the Form.Shown event.

override
OnStyleChanged(EventArgs)
Documentation for this section has not yet been entered.
override
OnTextChanged(EventArgs)
Documentation for this section has not yet been entered.
override
OnVisibleChanged(EventArgs)

Raises the Control.VisibleChanged event.

override
ProcessCmdKey(ref System.Windows.Forms.Message, System.Windows.Forms.Keys) : bool
Documentation for this section has not yet been entered.
override
ProcessDialogChar(char) : bool

Processes a dialog character.

override
ProcessDialogKey(System.Windows.Forms.Keys) : bool

Processes a dialog box key.

override
ProcessKeyPreview(ref System.Windows.Forms.Message) : bool
Documentation for this section has not yet been entered.
override
ProcessMnemonic(char) : bool

Processes a mnemonic character.

override
ProcessTabKey(bool) : bool
Documentation for this section has not yet been entered.
override
ScaleControl(System.Drawing.SizeF, System.Windows.Forms.BoundsSpecified)

Scales the location, size, padding, and margin of a control.

override
ScaleCore(float, float)

Performs scaling of the form.

override
Select(bool, bool)

Selects this form, and optionally selects the next or previous control.

override
SetBoundsCore(int, int, int, int, System.Windows.Forms.BoundsSpecified)
Documentation for this section has not yet been entered.
override
SetClientSizeCore(int, int)

Sets the client size of the form. This will adjust the bounds of the form to make the client size the requested size.

override
SetVisibleCore(bool)
Documentation for this section has not yet been entered.
override
UpdateDefaultButton()

Updates which button is the default button.

override
WndProc(ref System.Windows.Forms.Message)
Documentation for this section has not yet been entered.

Public Events

Activated

Occurs when the form is activated in code or by the user.

AutoSizeChanged

Occurs when the Form.AutoSize property changes.

AutoValidateChanged

Occurs when the Form.AutoValidate property changes.

Closed

Occurs when the form is closed.

Closing

Occurs when the form is closing.

Deactivate

Occurs when the form loses focus and is no longer the active form.

FormClosed

Occurs after the form is closed.

FormClosing

Occurs before the form is closed.

HelpButtonClicked

Occurs when the Help button is clicked.

InputLanguageChanged

Occurs after the input language of the form has changed.

InputLanguageChanging

Occurs when the user attempts to change the input language for the form.

Load

Occurs before a form is displayed for the first time.

MarginChanged

Occurs when the Form.Margin property changes.

MaximizedBoundsChanged

Occurs when the value of the Form.MaximizedBounds property has changed.

MaximumSizeChanged

Occurs when the value of the Form.MaximumSize property has changed.

MdiChildActivate

Occurs when a multiple-document interface (MDI) child form is activated or closed within an MDI application.

MenuComplete

Occurs when the menu of a form loses focus.

MenuStart

Occurs when the menu of a form receives focus.

MinimumSizeChanged

Occurs when the value of the Form.MinimumSize property has changed.

ResizeBegin

Occurs when a form enters resizing mode.

ResizeEnd

Occurs when a form exits resizing mode.

RightToLeftLayoutChanged

Occurs after the value of the Form.RightToLeftLayout property changes.

Shown

Occurs whenever the form is first displayed.

TabIndexChanged

Occurs when the value of the Form.TabIndex property changes.

TabStopChanged

Occurs when the Form.TabStop property changes.