"VB Super Simple Introduction" three, start programming

Source: Internet
Author: User
Tags support microsoft

The next step is to get to the chase! Students should look seriously ~

First step: Install VB Development IDE

Here I recommend that you install the VB Mini version, now most students use Win7, this version can be run on the Win7 of the duly ~

Download Link: Http://pan.baidu.com/s/1c1EnV5Q (here is a description of HA, this version is provided to you to download only for learning, please buy genuine support Microsoft Ha ~ ~)

It's like this when you open it ~ ~

And then keep on the next step.

Select the installation components, recommended all

Step two: Open VB New Project

After the installation is complete, run VB, the interface such as:

New project, select "Standard EXE", click OK.

Some students may encounter the problem of the VB interface, you can download my this gadget repair, download link: Http://pan.baidu.com/s/1sld5V0T

Run interface

Enter the path of the VB installation, and then click on a button to repair, you can. (Note to run with Administrator privileges)

The third step: first meet and familiarize yourself with VB The development Environment ~

Before programming, we need to familiarize ourselves with the development environment of VB, so that we can learn programming to be handy haha ~

Let's get to know all the parts of VB interface ~

L First is the title bar

The title bar, at the top of the development environment, displays the name and working status of the project being operated on.

The menu bar contains all the commands available to VB, in addition to the standard file, edit, view, window, and help menus, as well as programming-specific project, format, and debug menus.

The toolbar provides quick access to commonly used commands in the VB development environment. By default, VB only displays the Standard toolbar when it starts, and other toolbars, such as the Debug and edit toolbars, can be displayed by selecting commands on the Toolbars submenu of the View menu.

L followed by the Toolbox , as shown on the right:

Each tool in the toolbox represents a control. Programmers use tools in the Toolbox to draw a variety of controls on a form when the interface is designed.

In a new project, the toolbox includes only internal controls.

Additional controls (ActiveX controls) can be added to the toolbox through the Add Part command.

L Form Layout Bar ~

The initial display position on the screen when the form is run can be set through the form Layout window. In the Form Layout window, there is a virtual display screen with a mirror image of the current form size and position on the screen, which you can use to drag the image to position the form.

L Engineering Manager ~

In VB, the development of an application as a project, the project itself through the project manager to manage. In the project manager, all files in the project are displayed hierarchically by type. Files in the project have form files, standard module files, class module files and other types ~

L Properties Window

The Properties window is used to set object properties, which are composed of object list boxes, sort tabs, property lists, and property descriptions. The Object list box displays the name and class of each object in the application, the Sorting tab has two, one alphabetically arranged property, the other arranges the attributes in a logical category, the left column of the property list displays the property name, the right column is used to edit and view the property value, and after you select a property in the property list, A functional description of the property is listed in the property description.

The PS:VB development environment also contains other windows, such as code windows for writing program code, for debugging program immediate windows, local windows, and monitoring Windows, which are opened as needed during programming.

Fourth step: Start writing the first program!

After everything is ready, you can start our VB Tour, and now began to write the first program ~ First of all, of course, the new project ~

And then! Click the button on the left-hand toolbox

In the middle of the form to draw a button thick to ~

To set the properties of a button:

Change the Caption property to: First program

The Caption property is the text displayed above the button, so we can see the effect of the change.

ok~ Perfect!

And then we're going to start doing something substantial.

Next double-click this button to open the Code window, ~

In

Private Sub Command1_Click () End Sub

Enter the code between the following code:

MsgBox "The first program! "

(Note: Double quotes are double quotes in English, not Chinese!) MsgBox is a function that functions as a popup message box)

Then, save the project, press the F5 key on the keyboard, or the small triangle button in the toolbar to run the program ~

Running results such as ~

Click on the button to try what effect

So the first program is written to complete, students can click "File-to-build project" To compile the program, is not super sense of accomplishment it ~

"VB Super Simple Introduction" three, start programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.