My First Program



Read and add posts to the Visual Basic 6.0 Forums

Download some of my programs and OCXs

Read the Tips here

The old style forum is still available here



Beginner Tip

Now that you know how to create a Standard EXE Project, the first program that is traditionally made is the 'Hello World' program. Here is how you do it with Visual Basic 6.0:

1. On the General combo box of the code window, choose Form and the following text will appear:

Private Sub Form_Load()

End Sub

2. Between these two lines, type:

MsgBox "Hello World"
Unload Me

The MsgBox function displays a message box with 'Hello World' as its caption.  The line underneath - Unload Me, unloads (closes) the program.

3. Press F5 to start the program and the following dialog box will appear:

4. Congratulations, you have made your first program and can now be called a programmer!

Previous < Creating a Standard EXE Project Next > Using the If Statement

Archived Comments

From: manimaran
Date: Sunday, December 27, 2009 at 15:15:48
From: Rangana Rajapakshe
Date: Tuesday, June 2, 2009 at 12:15:21
Comments: This is good for the biginners to vb 6.0
From: erika
Date: Friday, May 29, 2009 at 23:13:59
Comments: Sorry sir

I'm reading this website right now..

I'm student of higher school in STMIK bekasi.
I like all of komputer.

And for me program has made me become "thinking of logical"

I'm sure,
next time I will become a programmer..

So,u're tUtorial is very g0od to me..

It's nice and simple..

My question is:
1. How to study database with easy and enjoy in program world.
2. What is u're ways to me become a profesional programmer.

Thank you so much.

From: Premath <Rhetoricverses@gmail>
Date: Saturday, May 9, 2009 at 15:36:20
Comments: This is a classical visual basic whom ever who came up with an idea of creating it i'm sayin' big up's keep a good work up
From: eric
Date: Saturday, September 27, 2008 at 02:59:03
Comments: your program is for begginer only!!!!! it is not so complicated and harD!!!
From: garima
Date: Monday, September 22, 2008 at 08:16:56
Comments: nice but simple
From: chanaka munasinghe
Date: Tuesday, September 4, 2007 at 07:54:25
Comments: this is a very good and assential work for us.because iam still student of higher national diploma in engineering institute.vb programs very essential for I like to thanks all of you.
From: zohaib
Date: Thursday, August 23, 2007 at 18:01:44
Comments: its a very good site for those who want to learn vb sir plz give some thing more about data base
From: vbnewbie
Date: Friday, November 10, 2006 at 02:46:47
Comments: you have my greatest gratitude... even though i'm a teacherj, i still have to learn more about vb. once again thanks...
From: sanya guleria
Date: Wednesday, November 1, 2006 at 07:19:33
Comments: I think u r doing a g8 job explaining things in so simple manner 4beginners like me.Thanks a tonne.Please send me some typical programs on my mail id which i can try myself.that will gimme self confidence.
From: blair
Date: Saturday, September 9, 2006 at 21:11:24
Comments: sir...
i would like to express my gratitude for a really cool site especially for beginners like me..i really appreciate it.its a great help for me because im just a student learning the basics of vb..:)
From: Naren
Date: Tuesday, June 28, 2005 at 00:02:29
Comments: Thanx 4 Everything U r doing 4vb users
From: PrOgRaMmInG mAsTa
Date: Friday, June 10, 2005 at 06:59:03
Comments: If you are looking for good tutorials dont bug him, hes just trying to teach beginners, dont go off on him for having a small program.Instead of looking at tutorials why dont you get off your lazy asses and explore visual basic.
From: May <>
Date: Monday, May 30, 2005 at 13:00:06
Comments: I am amazed that if one created a hello world program can already be called as programmer.Pls send me sample programs on my email..tnx so much!!
From: Andrew Swa
Date: Wednesday, April 27, 2005 at 09:23:29
Comments: I think you are doing a great job and worth a pat on the shoulder, continue helping people like me.
From: fatos
Date: Thursday, February 3, 2005 at 17:41:52
Comments: it is a very great for beginners but i would like to get more stuff and toturials and if you can give me some code examples so i can learn much better cause i want to be a programmer to program some programs that are very usefful for people thanks and i hope you give some codes and toturials via email ok thanks....
From: shagufta
Date: Friday, January 14, 2005 at 18:53:51
Comments: good to complete my first vb program and to be called as a programmer
From: anonymous <None>
Date: Thursday, January 13, 2005 at 21:45:17
Comments: Well didn't know you could type that little of code and get a message box. I didn't just because you make simple programs you could call your self a programmer.
Thanks I will try it!
Date: Tuesday, January 11, 2005 at 09:49:04
From: bob
Date: Tuesday, November 23, 2004 at 20:43:37
Comments: Well I think they are well explained, easy-to-use tutorials for beginners, good job :)
From: --=The X-Ploitor=-- <Secret>
Date: Friday, October 29, 2004 at 20:33:06
Comments: To be honest , these tutorials are really worthless !
Like , if you do spent your time on the net make`in tutorials on VB , why can`t you write something usefull ? Like a remote Port Scanner or somethin ?

This stuff you are writing , even noobZ can come up with that ! Write cool tutorials ! Like FTP`erz , port scanners , database developpment etc.

From: jhe-are
Date: Thursday, September 9, 2004 at 03:24:59
Comments: i tink your program s simple as a first year can do it,pls...give as programs that are very unique and for us to enjoy.tanx!
From: Lindy
Date: Thursday, August 5, 2004 at 14:05:02
Comments: Your sample programs really help a lot coz some of your examples are just like our case studies.Thank You!
From: philippe
Date: Monday, July 12, 2004 at 08:33:37
Comments: sir

i think your VB tutorials are very difficult.

I recommend YOU studying more b4 implying odd statistics.

no offense
Philippe Cruz

From: walid alkadri
Date: Sunday, May 9, 2004 at 15:38:46
Comments: hello this program is suitable for begeiners .
and in this occasion iwant to expression my thanks to you.
                      good luck.
From: Phil S
Date: Monday, March 29, 2004 at 21:33:49
Comments: I think the Hello World MsgBox is a goodway to get beginners into any programing app. I just don't understand this guy with " I made a Media Player for my first app" Don't thinkso DUDE. GREAT SITE HERE KEEP UP THE GOOD WORK!
Date: Monday, December 8, 2003 at 17:49:52
Comments: You see there are some ppl in this world who are greedy pigs....well what they want is that no 1 should share the knowledge of this world. One of these ppl is some1 who posted their view on this site and that person is as he put his name Dark_Vision. Well Dark Minded being here is your answer don't feel jalous this man did a great job, instead of showing you could do stuff like that why can't u come up with something like this, this is A GREAT MAN'S JOB. MR MARTIN PERSONALLY I THANK YOU FOR WHAT U DID. PLEASE FORGIVE SOME1 LIKE DARK VISION FOR HE TRULLY SPOKE ABOUT HIM/HER SELF ON THEIR NAME "DARK VISION" sorry Dark_Vision the world aint dark any more. Welcome to the bright world. Martin once again thankx man keep up the great work. And may your God Reward you.
From: kasun
Date: Monday, September 1, 2003 at 09:33:57
Comments: ur web site is really goob for the beginners who wish to become programmers. sir can u send me codes to do a excellent programme
thank you.
Date: Tuesday, July 29, 2003 at 02:38:28
Comments: Hello, I know that for the icons in MsgBox's, like these:
I need the 2 other ones (The ! one and the ? one)
Please Help!
Reply: The constant for the exclamation mark is vbExclamation and for the question mark, it is vbQuestion.
From: amri
Date: Friday, June 20, 2003 at 09:48:58
Comments: its good program for new programmer
From: Dark_Vissions
Date: Friday, June 13, 2003 at 17:04:48
Comments: That was your first application hmmmm most of the simple coding is common sense like opening another form, ' simple. My first application was a media player.
Reply: You are missing the point.  The above code is for someone who knows absolutely nothing about Visual Basic 6.0.  I'm sure you learnt the MsgBox function before you made your Media Player.
From: Celcius0
Date: Thursday, June 5, 2003 at 05:47:06
Comments: This website is great. I am fairly good at programming
but this website is a great reference. THANK YOU.
From: jen
Date: Wednesday, May 28, 2003 at 20:53:13
Comments: Thank you, 

I was going mad trying to figure out how to open another form. 

Very helpful site!

From: echa
Date: Wednesday, May 28, 2003 at 04:39:12
Comments: it's very nice given idea to me an thanks very much
From: carmen
Date: Sunday, May 25, 2003 at 20:15:41
Comments: you see this is what i need something that takes you to the basics of vb.  at the minute im designing a program for my hnc and this site has been a great help.  if you can offer any other help please feel free to send any ideas. thanks
From: snuffy smith
Date: Thursday, April 24, 2003 at 01:51:27
Comments: Thank's Now I am ready to continue
From: Sheryl <Liban>
Date: Friday, April 11, 2003 at 10:58:26
Comments: Can you send me a simple program through my email add, give some example used as a Visual Basic.
Will give me some exampe used in a Visual Basic Program
i hope you for give my message.

                                    Thank You

Reply: There are hundreds of example projects available from this website:

VB Helper How To - Free Visual Basic Programming Downloads

Click on the links - Beginning, Intermediate and Advanced for the project level.

From: zahid
Date: Saturday, March 8, 2003 at 14:28:55
Comments: it is really very great site for beginers.sir can u send me some good ideas and code by email to me.i want to make some kind of office data base.
Date: Monday, January 6, 2003 at 08:40:12

Martin Allen 1999 - 2011.  Last updated Monday 08 August 2011 07:17:40 PM +0100.