Continue Programming in Visual Basic 6.0
VB Lesson 1 (Continue)
By Sergey Skudaev
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
We continue learning how to create simple Visual Basic Application. Visit the previous page if you did not read it.
Select Project from main menu and select Add Module. Hover mouse over a thumbnail to see a large image.
Add module window displays. Select New Module and click OK
Select module from Project window and rename it to WinMain
Select Tools, Add Procedure
Type procedure name: main.
Select scope Public. Usually, it is already selected. Type inside Public Sub main procedure: "frmMain.Show"
Select Project, Project properties
On general tab type "Hello World"in project name field. In StartUp Object field select Sub Main
Double click Show Message command button on the form. Type the code:
lblMessage.Caption = "Hello World!"
Inside the Private Sub cmdShow_click() procedure. This code will be executed when user clicks Show Message Command button.
Your hello world application is ready to run. Select Run icon from main tool bar.
Visual basic prompts you to save project.
Save all project files in the start_vb folder
When you saved project, Hello World form displays. Click Show Message button. Message displays
Congratulation. You created your first Visual Basic application.
How it works?
Execution starts from sub main procedure. This procedure is defined in module as a public. It means the procedure has global scope. The code inside the sub main procedure is
frmMain.show.
frmMain is a name of the form.
Show is its method or function. When show method is executed the form displays.
When user clicks the Show Message button, button click event occurs. On button click event cmdShow_click procedure is executed. The code inside cmdShow_click procedure is
lblMessage.Caption = "Hello World!"
lblMessage is a label name. Caption is a label property. When code is executed, the string "Hello World" is assigned to label caption and is displayed on the label. The label background color, font and font color are label properties and can be set in the properties window or by code.
If you have any question or comments please register and post comments.
Password Keeper VB Application
Please rate the tutorial
Learn SQL Programming By Examples [Kindle Edition]2.99
Learn PHP Programming by Examples [Kindle Edition] $2.99
Learn Visual Basic 6.0 [Kindle Edition] $1.99
How to Build Your Own Web Site from Scratch [Kindle Edition] $1.49
New-trip.com website source code
| Comments | |
|---|---|
You can find a lot of resources on Internet to start learning VB. Visit link http://www.appdev.com/visual_basic_training.asp
- Home
- start_vb_cont
- Batch Files
- Java Properties
- Form Validation
- Display Image PHP
- Upload File PHP
- phpMyAdmin
- Environment Variables
- Delete Trojan horse
- VB Code Examples
- Learn Visual Basic
- VB Form Events
- VB Password Keeper
- Deployment VB App
- Using API in VB
- Database Design
- Password Keeper
- MySQL and Excel
- Learn MySQL
- Learn PHP
- Learn C++
- Learn Java
- Web Site Tips
- User_Auth. Demo
- Set Shopping Cart
- Using Twitter
- Advertise here
- Site map
- Registration
Web programming Tips