Visual Basic is a Microsoft programming language that allows you to create desktop applications. The language has been replaced by VB.NET, but it is still used in the market for older software updates and configurations. Forms are the very basic component of a VB application, so understanding the layout, coding and design helps developers get started in using these components.
When the programmer first opens a project, a default form is created. This form is the start of the program when the application is first run. The form looks like a blank application window you see when you open any Visual Basic software program. The form is named "Form1," but this name can be changed in the properties window, which is in the bottom-right corner of the Visual Basic programming console.
Although the form has a default background of gray, it can be changed in the properties window. Several changes can be made using form properties and without any kind of coding in the code-behind file. These properties include background color, font styles, font colors and transparency, and the developer can remove any minimize or maximize buttons. The form can also be set to start in the location it was when the user last opened the program, or it can be set to open anywhere on the user's screen like the center. A common change programmed on any form is changing the title on the title bar through the properties window.
Design View vs. Code View
Two windows are available while coding for a form. Design view is the layout where the developer can drag and drop components onto the form. Components include input objects like text boxes, list boxes, command buttons and images. These components are all found on the toolbar on the left side of the Visual Basic console.
Code view is the area in which the programmer types the code that manipulates the form and the components added to the form. Code view for the main form shows the "Main" function, which is the starting point for the application.
Components are the text boxes, list boxes and command buttons added to forms. These components are used to receive and send data to the user. When creating forms, it's important to place these components in a user-friendly arrangement. Part of form design is making it intuitive for users to find the commands needed to work with the application.
Working with the code-behind file is a necessary part of coding for forms. Below is a sample of a Visual Basic code snippet:
Private Sub Form_Load()
Dim hello as String
hello = "Hello World!"
This snippet is run when the form is loaded. The "Form_Load()" is an event that is fired every time the form is opened. This is a simple example that displays a message box that says "Hello World" to the user.
What Is Visual Design?
Visual design is the way a piece of artwork, a room, yard, video game, photo or other artistic subject is composed and...
How to Create Forms in Microsoft Access
Microsoft Access has made creating forms an easy experience. Microsoft Access is a database. Its purpose is to store and arrange information....
How to Create Forms With Visual Basic
Since it was first released by Microsoft in 1987, Visual Basic (VB) has developed into one of the United States' leading programming...
Definition of MS Word
The term "Microsoft Word" has many definitions because this application can perform many functions. Word's text editing functions make this program a...