Form Control in C#

Public properties of the Form Class

Property Description
AcceptButton Gets or sets a button on a form when a use presses the Enter key
ActiveForm Gets the current active form of an application
ActiveMdiChild Gets the current active multiple document interface (MDI) child window
AllowTransparency Gets or sets the value to adjust the transparency of a form
AutoScaleBaseSize Gets or sets the base size used to autoscale a form
AutoScroll Indicates whether a form implements autoscrolling
AutoSize Resizes a form as per the settings of the AutoSizeMode property
AutoSizeMode Gets or sets a more to make changes in the size of a form
AutoValidate Gets or sets the value that indicates whether the controls will be validated automatically when their focus is changed
BackColor Gets or sets the background color of a form
CancelButton Gets or sets the button control that is clicked when a user presses the ESC key
ClientSize Gets or sets the size of a client area
ControlBox Gets or sets a value indicating whether a control box is displayed on the caption bar of a form
DesktopBounds Gets or sets size and location of a form on desktop
DesktopLocation Gets or sets the location of a form on desktop
DialogResult Gets or sets the value of the dialog result property for a form when it is displayed as a modal dialog box.
FormBorderStyle Gets or sets the border style of a form
HelpButton Gets or sets the value indicating whether the Help Button should appear in the caption box of a form
Icon Gets or sets an icon form a form
IsMdiChild Gets or sets a value that indicates if a form is an MDI child form
IsMdiContainer Gets or sets a value that indicates if a form is a container for MDI child forms
IsRestrictedWindow Gets a value that determines whether a form uses all the windows and user input events without any restriction
KeyPreview Gets or sets a value that determines whether a form receives all the key events before an event is passed to an active control
Location Gets or sets the location of a form
MainMenuStrip Gets or sets the menu container for a form
MaximizeBox Gets or sets a value that determines if the Maximize button is displayed in the caption bar of a form
MaximumSize Gets a value that indicates the maximum size of a form
MdiChildren Gets an array of MDI child forms of a parent form
MdiParent Gets or sets teh current MDI parent form of a form
Menu gets or sets the Main menu that is displayed in a form
MergedMenu Gets the merged menu for a form
MinimizeBox Gets or sets the value that determines whether the Minimize button is displayed in the caption bar of a form
MinimumSize Gets or sets the minimum size of a form
Modal Gets a value that determines if a form is displayed in a modal dialog box
Opacity Gets or sets the opacity level of a form
OwnedForms Gets an array of Form objects of all forms owned by the parent form
Owner Gets or sets the parent form that owns a form
RightToLeftLayout Gets or sets the value that determines whether the right-to-left placement is turned on.
ShowIcon Gets or sets a value that determines whether an icon is displayed in the caption bar of a form
ShowInTaskbar Gets or sets a value that determines whether a form is displayed in the Windows Taskbar
Size Gets or sets the size of a form
SizeGripStyle Gets or sets the style of the size grip to be displayed in the lower-right corner of a form
StartPosition Gets or sets the starting position of a form at runtime
TabIndex Gets or sets that tab order for the controls in a form
TabStop Gets or sets a value that determines whether a user can give focus to a form by using the Tab key
Text Gets or sets the text associated with a form
TopLevel Gets or sets a value that determines whether a form should be displayed as a top-level window
ToMost Gets or sets a value that determines whether a form should be displayed as the topmost form of an application
TransparencyKey Gets or sets the color representing the transparent area of a form
WindowState Gets or sets a value that indicates whether a window is restored, minimized, or maximized

Public methods of the Form Class

Method Associated function
Activate Activates a form by giving it focus
AddOwnedForm Adds an owned form to the parent form
Close Closes a form
LayoutMdi Arranges MDI child forms within the MDI parent form
RemoveOwnedForm Removes the owned form from the parent form
SetDesktopBounds Sets the bounds of a form with desktop coordinates
SetDesktopLocation Sets the location of a form with desktop coordinates
ShowDialog Displays a form as a modal dialog box
ToString Gets a string representing the current instance of a form
ValidateChildren Validates all selected child controls of a form

Public Events of the Form Class

Event Description
Activated Occurs when a form is activated through the code
Closed Occurs when a form is closed
Closing Occurs when a form is closing
Deactivate Occurs when a form loses focus
FormClosed Occurs after a form is closed
FormClosing Occurs before a form is closed
HelpButtonClicked Occurs when the Help button is clicked
InputLanguageChanged Occurs after the input language of a form is changed
InputLanguageChanging Occurs when a user tries to change the input language of a form
Load Occurs before displaying a form for the first time
MaxmizedBoundsChanged Occurs when the value of the MaximixedBounds property has been changed
MAximumSizeChanged Occurs when the value of the MaximumSize property has been changed
MdiChildActivate Occurs when an MDI child form is activated or closed within an MDI application
MenuComplete Occurs when the menu of a form loses focus
MinimumSizeChanged Occurs when the value of the MaximumSize property is changed
ResizeBegin Occurs when a user begins resizing a form
ResizeEnd Occurs when a user finishes resizing a form
RightToLeftLayoutChanged Occurs when the RightToLeftLayout property changes
Shown Occurs when a form is displayed for the first time
TabIndexChanged Occurs when th value of the TabIndex property changes


Write a comment


Name Email Message