This is the famous universally recognised first stage of a tutorial used in every programming language from Java to C++. This tutorial will show you in Visual Basic 5 (same as 6) but this does not matter as this example can be done in any version of Visual Basic.
Printer Friendly Download Tutorial (42.4KB) Download Source Code (7KB)
Step 1
Load Microsoft Visual Basic, then select Standard EXE Project if VB5/6, click on the option then click Open, see below:
Step 2
A Blank Form named Form1 should then appear, see below:
Step 3
Then from the Visual Basic Components Menu Select the Command Button Control:
Step 4
Draw a Command Button on the Form, see below:
Step 5
Then goto the Properties box and change the Caption property from Command1 to Click Here, see below:
Step 6
Double Click on the Command Button and type in the Command1_Click() Sub:
MsgBox "Hello World",vbInformation,"Test"
See Below:
Step 7
Save the Project (for example prjHelloWorld) into a vacant folder as you have finished the application. Click on Start / Run or Press F5 and the below will appear:
Step 8
Now Click where it Says Click Here and a Message Box will appear, which will look something like this:
Step 9
Just Click Ok and End / Stop the application.
That was your first working Visual Basic Application! Try changing the Text or the Title, which is the last part after the vbInformation remark, or have a go at changing the code and extending it, you can learn a lot from this simple application!