2. Creating Your First Application

In this section, we will not go into the technical aspects of the WB programming, but is aware of it. Now you can try the examples below:

Example 2.1.1 is a simple program. First of all, you need to launch Microsoft Visual Basic. Normally standard form Form1 is available, you can start a new project. Now, double click on Form1, the source code window Form1, as shown in Figure 2.1 will be seen. The upper part of the source code window consists of a list of objects and of related events or procedures. Figure 2.1, the object appears in the form and procedure related to what is a burden.

When you click on the object's box, drop-down list to see the list of objects, you have been added to the form as shown in Figure 2.2. Here you can see a form of a command button, whose name has been Command1, a label with the name of Label1 and PictureBox, whose name has been picture1. Similarly, when you click on the procedure box, a list of related object is shown in Figure 2.3. Some of the procedures related to the object form, is to activate, click DblClick (which means Double-Click), DragDrop, and keyPress, etc. Each object has its own procedures. You can select an object and enter codes for any of the action in order to perform certain tasks.

You do not have to worry about in the beginning and end of statements (ie Private Sub Form_Load ....... End Sub.) Just the key between the lines for more than two statements, just as it is presented here. When you start the program, you have to be a surprise that there was no indication. In order to show the output of the program, add Form1.show statement as the example of 2.1.1, or you can use Form_Activate () case, the procedure as set out in the example 2.1.2. Print Command does not mean using the printing of the printer, it means that by showing the production of the computer screen. Now, press the F5 or click on the Run button, and run the program and you get output, as shown in Figure 2.4.

You can also perform simple arithmetic calculations, which can be seen, for example, 2.1.2. VB * used to describe a report on the operator and / to denote division of the operator. The results are shown in Figure 2.3, if the results are arranged vertically.

Postingan populer dari blog ini

vb6 msflexgrid

Tutorial Visual Basic 6.0 : Listbox in VB6

Select Single Cell in MSHFlexgrid