This type of feature, however, requires the use of a dynamic form name. After all, you won't know which form the user has selected, as you would with other pre-defined methods, such as opening a specific form when the user clicks a button. Fortunately, Visual Basic provides an easy way to reference a form dynamically with the Forms collection.
Let's start with creating a Window Forms Application by following the following steps in Microsoft Visual Studio - File → New Project → Windows Forms ApplicationsFinally, select OK, Microsoft Visual Studio creates your project and displays following window Form with a name Form1.Visual Basic Form is the container for all the controls that make up the user interface. Every window you see in a running visual basic application is a form, thus the terms form and window describe the same entity. Visual Studio creates a default form for you when you create a Windows Forms Application.Every form will have title bar on which the form's caption is displayed and there will be buttons to close, maximize and minimize the form shown below −If you click the icon on the top left corner, it opens the control menu, which contains the various commands to control the form like to move control from one place to another place, to maximize or minimize the form or to close the form. Form PropertiesFollowing table lists down various important properties related to a form.
These properties can be set or read during application execution. You can refer to Microsoft documentation for a complete list of properties associated with a Form control − S.NPropertiesDescription1AcceptButtonThe button that's automatically activated when you press Enter, no matter which control has the focus at the time.
![Vb6 Form Events Sequence Vb6 Form Events Sequence](/uploads/1/2/5/6/125639774/811839954.png)
Usually the OK button on a form is set as AcceptButton for a form.2CancelButtonThe button that's automatically activated when you hit the Esc key.Usually, the Cancel button on a form is set as CancelButton for a form.3AutoScaleThis Boolean property determines whether the controls you place on the form are automatically scaled to the height of the current font. The default value of this property is True.
Events are basically a user action like key press, clicks, mouse movements, etc., or some occurrence like system generated notifications. Applications need to respond to events when they occur.Clicking on a button, or entering some text in a text box, or clicking on a menu item, all are examples of events.
![Vb6 Vb6](/uploads/1/2/5/6/125639774/812730942.jpg)
An event is an action that calls a function or may cause another event. Event handlers are functions that tell how to respond to an event.VB.Net is an event-driven language. There are mainly two types of events −.Mouse events.Keyboard eventsHandling Mouse EventsMouse events occur with mouse movements in forms and controls.