envirementalb Logo
envirementalb Logo

Create Application Using Visual Basic 6.0

In this lesson, we will Create an Application Using Visual Basic 6.0. In this, we have only explained how to create an application in visual basic 6.0

 

First of all, launch Microsoft Visual Basic 6 compiler that you installed earlier. In the New Project Dialog, choose StandardEXE to enter the Visual Basic 6 integrated development environment. In the VB6 IDE, a default form with the name Form 1 will be presented. Now, double-click on Form1 to bring up the source code window for Form1 as shown in the figure given below. The top of the source code window consists of a list of objects and their associated events or procedures. In the source code window, the object displayed is Form1 and the associated procedure is Load. You do not have to worry about the beginning and the end statements (i.e. Private Sub Form_Load…….End Sub.) Just key in the lines in between the above two statements exactly as are shown here. When we press › to run the program nothing showed up. In order to display the output of the program, We have to add the Form 1. show statement like in this example.

Private Sub Form_Load ( )
Form1.show
Print “Welcome to Visual Basic tutorial”
End Sub

. The command Print Command means displaying the output on the computer screen. Now, press ›  or click on the run button to run the program and you will get the output as shown as.

We can also perform arithmetic calculations on the form by using vb6. VB uses * to denote the multiplication operator and / to denote the division operator. Example of Arithmetic operation.

Private Sub Form_Activate ( )
Print 20 + 10
Print 20 – 10
Print 20 * 10
Print 20 / 10
End Sub

Output

When we run these codes the output will be like that. This output can be taken in text boxes on labels on the command button and so on that, we will learn in later lessons.