Visual C#.Net Tutorial

Define Visual C#.Net

C# Form Control

C# Label Control

C# TextBox Control

C# Button Control

C# RadioButton Control

C# CheckBox Control

C# CheckListBox

C# ListBox Control

C# ComboBox Control

C# LinkLabel Control

C# DateTime DataType

C# DateTimePicker

C# NumericUpDown

C# RandomNumber

C# PictureBox

C# ProgressBar

C# Timer Control

C# ToolTip

C# TabControl

C# RichTextBox

C# MessageBox

C# Menu Control

C# Toolbars

C# Dialogs Box

Page Stats

Visitor: 3

Form Control

Form act as a container for all controls that make up the user interface.

Common Form Properties are:
Attributes Description
AcceptButton The button that is automatically activated when you press Enter.
BackColor Sets the form background color.
CancelButton The button that is automatically activated when you hit Esc key.
ControlBox Use to hide icon and disable the Control box button. By default, this property is True.
Enabled If False, disables the form.
Font Specify default font type, style, size
FormBorderStyle Determines the style and appearance of the form's border
None: Borderless window can not be resized.
Sizable: This is default value and will be used for resizable window that used for displaying regular forms.
Fixed3D:
FixedDialog: A fixed window, used to create dialog boxes.
FixedSingle: A fixed window with a single line border.
FixedToolWindow: A fixed window with a Close button only.
SizableToolWindow: Same as the FixedToolWindow but resizable. In addition, its caption font is smaller than the usual.
Height Specify height of the Form in pixels.
HelpButton Determines whether a Help button should be displayed in the caption box of the form.
MaximizeBox Use to hide the Maximize button on the title bar.
MinimizeBox Use to hide the Minimize button on the title bar.
MaximumSize Specifies the maximum height and width of the window you can maximize.
MinimumSize Specifies the minimum height and width of the window you can minimize.
Name This is the actual name of the form.
StartPosition This property determines the initial position of the form:
CenterParent: The form is centered in the area of its parent form.
CenterScreen: The form is centered on the monitor.
Manual: The location and size of the form will determine its starting position.
WindowsDefaultBounds: The form is positioned at the default location and size determined by Windows.
WindowsDefaultLocation: The form is positioned at the Windows default location and has the dimensions you’ve set at design time.
Text The text, which appears at the title bar of the form.
TopMost This property specifies whether the form will remain on top of all other forms in your application. Default value is False.
Common Form Methods are:
Attributes Description
Activate Activates the form and gives it focus.
Close Closes the form.
Hide Hide the Controls.
Show Displays the control to the user.
ShowDialog Shows the form as a modal dialog box.
Common Form Events are:
Attributes Description
Activated Occurs when the form is activated in code or by the user.
Click Occurs when the form is clicked.
Closed Occurs before the form is closed.
Closing Occurs when the form is closing.
Deactivited Occurs when the form is no longer in focus.
KeyDown, KeyPress, KeyUp Keyboard Events
Load Occurs before a form is displayed for the first time.
MouseDown, MouseEnter, MouseHover, MouseLeave, MouseMove, MouseUp, MouseWheel
Move Occurs when the form is moved.
Resize Occurs when the control is resized.