Some fundamental Visual Interface Components:
Throughout our previous articles on Visual Basic and Visual Programming, we hope you have gathered concept of what actually is visual programming and what differences it makes. Now, it’s time to explore in about the interfaces used in Visual Basic. These are shown below in Figure 1.
Figure 1: Some visual interface components.
A form, sometimes also called as window is the most important of all the visual interface components. As you can see in above figure, all those other components/controls are attached on the form. A form is the base for a user interface of the application. All the components that make up the user interface are placed in the window. Form plays vital role in Visual Basic Development Environment.
Form’s appearance can be designed by changing its properties and can be labeled by using label control.
A form in Visual Basic plays the role of the canvas in painting. Without the canvas painting cannot be done. Similarly without the form there is no user interface.
Form is a starting window for the application. So, all the interfaces and controls that programmer need to attach for a program’s completion should be well attached to the form. They cannot exist independent of the window.
Most often, programmer uses multiple numbers of forms in order to perform numbers of functions in a categorized and well-sequenced order. This can be taken as the art of a good programmer.
In every instance of visual programming, need of button is the most. A button, also referred to as command button or push button, is one of the most popular user interface components.A command button is the most basic way to get user input while a program is running. By clicking a command button, the user requests that a specific action be taken in the program. Or, in Visual Basic terms, clicking a command button creates an event, which must be processed in your program.
A button is used to initiate an action.
The text on the button indicates the action that it will initiate. Most commonly we see buttons with texts such as: OK, Cancel, Submit, Login, Help and so on. Those texts actually indicate the function/ procedure associated to the click event of the button. And as the user clicks the button then the procedure inside the button’s event procedure is initialized.
The Textbox control is one of the most versatile tools in the Visual Basic toolbox. This control performs two functions:
- Displaying output (such as operating instructions or the contents of a file) on a form.
- Receiving text (such as names and phone numbers) as user input.How a text box works depends on how you set its properties and how you reference the text box in your program code. The following popup illustration shows a text box that:
- Displays data entry instructions for the user.
- Receives input when the user types in a delivery note and clicks the Print Order button.
A very good example of Textboxes is the boxes where you enter comments in our web page. Make a good use of Textbox now by entering comments.
For example the application that requires:
- Phone number
From the user will present three text boxes, one for each piece of information.
Thus, text box is the means of accepting information from the user.
When you want a user to choose a single response from a long list of choices, you use the ListBox control. (Scroll bars appear if the list is longer than the list box.) Unlike option buttons, however, list boxes don’t require a default selection.List boxes are used to present the user with the possible options. The user can select one or more of the listed options.
The items must be inserted in the ListBox control through the code, or via the List property in the Properties window.
For example, in an order generating system the user is presented with a list box that displays all the products that are stocked by the shop. The user can select a product from this list.
The advantages of a list box are:
- The user need not memorize all the products available
- The user is prevented from entering an option that is not valid.
Furthermore, we will be discussing about the Controls used in Visual Basic in our upcoming article. For time being use what we have explored till now by Building your first project (Math Calculator).