Visual Basic is a great starter programming language. Not only is it easy to learn, but many business applications use it extensively for their applications. If you are just starting to learn to develop applications - this is a great language to start with. This tutorial and the many other Visual Basic tutorials at this site will give you a solid foundation in your Visual Basic knowledge.
Lets jump right in with a simple application. When you are done with this Visual Basic tutorial, you should have a complete working application that when you click on the button it will say "Hello, World"
Start Microsoft Visual Basic 6.0 (VB6)
The New Project dialog box will appear. If it doesn't go up to the menu bar and select File -> New Project
In the New Project dialog select Standard EXE, and click the Open Button.
This will bring up your new Project 1 application with Form1
visible.
Already Visual Basic has done a lot for us. As you can see
this tutorial isn't very long but already you have a full working application.
You can see your new program in action by going up to the menu bar and
selecting Run -> Start (Or simply press the F5 key).
This is a fully functional application. You can move it around, minimize and maximize it, and close it down. For you to do this same thing in C++ - the original language most of Windows was written in you would have written hundreds of lines of code. You area already getting to see some of the extreme power VB gives you. Now lets continue with the tutorial.
Lets make this program say hello!
On the left side of the screen you can see the toolbox (if this doesn't show up go to the top menu bar and select View -> Toolbox). In this toolbox you will see a picture of a button. Double click the button icon and it will create a Command1 CommandButton in the center of your form.
If you run the program now (Press F5) you will see your window now has a button labeled Command1 in the center of it, but if you click the button it doesn't do anything. So lets wire things up so our program will say "Hello, World" when you click the button. Close out of your running program so you are back to the main design environment (pictured above)
Visual Basic allows you to do event driven programming. This is a concept that is very powerful and easy to use. Event driven programming works as follows: Visual Basic has many different events defined that occur when a specified thing happens. We as the programmer can link into these events and write our custom code to do what we want. One very useful event is the Click event. This event occurs any time the user clicks on the specified object. I'm sure the wheels are already turning in your head, if we want to say hello world when someone clicks the button on our form than we should do something in the Click event for the Command1 button. That is exactly what we are going to do.
To write the click event code double click on the Command1 button. This will bring up the code editor and will automatically write the beginning code to handle the click event.
Now any code you put between the Private Sub ... and the End Sub statements will be executed when the user clicks the command button. To demonstrate this we will have a message box appear saying hello world. So add this line of code:
MsgBox is a built in Visual Basic function that causes a message box to be displayed to the user. The first parameter this function takes is the text string you wish to have displayed. We choose the text string "Hello, World!". MsgBox also takes other parameters to specify things such as what buttons to display and what caption to use, but these will be discussed later. For now lets see how this works. Run your newly created Visual Basic hello world program (Press F5). Once the program is running click the Command1 button, you should see a message box saying Hello, World! appear.
Congragulations! You have written a complete working Visual Basic program using this Hello, World tutorial. Read some of our other VB6 tutorials to learn how powerful this language really is.
Comments
Nc.... It help those
Nc....
It help those beginner like me to easily understand what is the function of that code...
hope you make more of them hehhhhe...
and represent it the way you represent "hellow World"
easy to understand....
you suck
that was horrible and you suck
You suck
that was horrible and you fucking
suck
i wish i could help u
ok help me people i am stuck on commanding a command button in vb6 help in the fnd if etc...
Beijing Tours
China TourChina ToursChina Travel AgencyTours In ChinaTour In ChinaTravel In ChinaChina Travel
Great Wall Tours
Beijing Tour
Beijing Tours
Tour In Beijing
Tours In Beijing
Travel In Beijing
Beijing Coach Tours
Beijing Bus Tour
Beijing Bus Tours
Beijing Coach Tour
Beijing Day Tours
Beijing Day Tour
Xian Tour
Xian Tours
Guilin Tour
Guilin Tours
Yunnan Tour
Yunnan Tours
Shanghai Tours
Shanghai Tour
Zhangjiajie Tour
Zhangjiajie Tours
Tibet Tours
Tibet Tour
cheap replica handbags
Welcome to Discount Timberland ,bootsonline store- timberland
boots,Timberland shoes Timberland Women's boot
,timberland kids boots,cheap timberland Free Shipping On
Over $180 !! cheap replica
handbags Replica Louis Vuitton Handbags,Hermes Birkin handbags
Cheap Louis Vuitton
Untitled
it's great to see that boring people do boring jobs, like yourself(programmers). keep the internet going ;)
Attack on subterrainian Culture (Anarchy)
Dwarf Shortage
Untitled
it's great to see that boring people do boring jobs, like yourself(programmers). keep the internet going ;)
This doesn't work with
This doesn't work with Visual Basic 10. It's quite annoying.
You should look into the
You should look into the vb.net stuff for that. vb6 is not code compatible to vb10.
Need more conformation
I need a code for saving the files created in the VB with own file format.
Can anyone help me with this.
...Look Down...
hey i suck when it comes to vb6 coding but i have relaced a program to change the start button text For Windows XP AND XP ONLY!!!!!!!!!!!!!!!!
Good luck
Get It Free @
startbuttonchangerxp.webs.com
thats nice
thats nice
code writing
good day sir, in case like these- private sub form (). what is suppose to be in the bracket. is it write up like this or not. e.g (ByVal Sender As System.Object,_ ByVal e As System.EventArgs).
please help because i have written some program but that is where is holding it from running.
THANKS
I can help if it is needed!
Hello Everyone!
I have taken Computer Programming, Software Applications, Desktop Publishing, Computer Design and more. If anyone needs help writing code for a program please email me at drekryan@yahoo.com and explain what you need with a much information as possible!
Good Luck! :)
visual basic
hi sir gud day can you help us about the coding simple login and logout system. thank you
5 star
exactly for the begginer like me ^_^
Hello, World!
Hi,
Learning is made very simple by well written in simple step by step instructions.
Thanks a lot.
subburaj ramiah
thank you for helping me in
thank you for helping me in my exam...
Thank YOU
this is awesome for beginners. thanks
Thanks!
Very helpful.. thanks!
hi
its help a lot to the studint like me...thank you so much...
awesome
very good article, easy to read and learn, thank you x100!
Wow!
I'm Jonalyn
Wow! So thankful that you have tutorials like this...
It's a big help for beginners and amateurs who can't understand VB that much.......
A many thanks to you, and for all the people who helped put it all together......mwahh
Best Wishes!!
Arigatou Gozaimasou!
Thanks a lot
Thanks a lot for providing such a great resource...Now I am trying to learn VB 6 ..and I will follow your website....I am really thankful to you ...
i want the program visual
i want the program visual basic vb now
Texts and labels
I've tried most parts of VB, and they are very interesting, but is there any way the background of the text and the label be made transparent.
Thank you.
Books traking system
What is required to start my application that will store books information in the library including books location in the shelves, keep track of borrower information.
plz i would like your contribution on that.
thanks
wow this program is realy interesting. hw i wish u cud send more program tutorials or beta still tutorials on hw these visual basic code works.
msgbox
wow...msgbox it's easy as our teacher teach us about that...!!!
i love it...that's easy!!!
Visual basics
dfg great it is really a lovely programme.I enjoyed it.give some more programme that will build the knowledge in programming.
Thnx much
Im the beginner \in programming and this is ma last year to complete 3yrs in computer engineering
I suppose to conduct a project so as to graduate
it was very difficult for me to conduct it
bt im now prepare ma self to create a program that will store information for every students in our college
now im very happy to see your tutorial like this and im sure ma problem will be solved
plz any one can help me on that project im going to conduct?
by bunally@yahoo.com
I can be your partner in that...
that kind of work is difficult but it would be easy if there would be TWO brains that will function than one...you can ask me if y0u want...
vb6 user details capture screen code examples
can someone help and send me some codes on programs like, LOGON FORM/SCREEN, CUSTOMER DETAILS CAPTURE SCREEN/FORM and other codes for capturing details and store them in a database
GREAT MAKE MORE!!!
GREAT MAKE MORE!!!
Great
Simple. Facile. Comprehensive. Scores of thanks. But little by little the cotton threads become cloth: so please more & more.
very nice tutorial.. i want
very nice tutorial.. i want some more!!!
how bout those that uses equations!!!
thanx
thanx really... ive been looking for some friendly tutorial, and finally found it
Thanks Alot! it was very
Thanks Alot! it was very helpful. and is helping me alot already
First timer...
Tis really helps...very straight forward...thnx...
Good Tutorial
Good Tutorial
wow..........kjn kjnc kjncv
wow..........kjn kjnc kjncv
So brilliant!!!
It really helps me a lot.....
please send me other coding tutorials I really liked it.
Thanx for your brief and undustandable explanation of codes. Please add me as many coding tutorials as you can. I wanna be an expert in programming.
visual basic6.0 program
please send me other coding related to visual basic6.0
Easy
This was easy. Love it ^^
this was ok love basil mwah
this was ok love basil mwah xoxo
jm
wow! this is great... very well explained! love it dude.. thanx a lot!!!
Great
Very simple, clear and effective. Good job!
Nice
Thanks dude. This thing really helped me..and now my family is impressed with me. But I couldn't have done it without you. Thanks and Continue making tutorials like this. People (including me) love 'em!
Clean and includes source.
Clean and includes source. A+ =)
thanx
this is the first tutorial i see that works..thanx men..
Im just a Newbe..and a wanna be programer..till college.
tnx
tnx for this simple tutorial......... -erg23
THANX
HEY THANX MAN.DIS TUTORIAL IS REALLY HELPFUL ..WELL HOPE I WILL BE A MASTER SOMEDAY.
THANX
HEY THANX MAN.DIS TUTORIAL IS REALLY HELPFUL ..WELL HOPE I WILL BE A MASTER SOMEDAY.
Awesome.
I really appreciate the explanation of even the "MsgBox" feature and how you go in depth on what it does. Most tutorials just give you the code and say "awesome your first project is done." In fact you EXPLAIN that feature which is REALLY needed. Thank you.
Cheers!
Thanks that just got me started!!! MORE MORE!
Very Useful
This Visual Basic tutorial was very helpfull in helping me know how to just make something simple. I would like more tutorials like this that are geared towards the beginner.
nice work
I like the way the lessons are presented...
COMPLETE PACAKAGE
let me say u thanks..coz i have search the whole worls fo visual basic tutorial........but do trust me it the best i have found ever.just start from the 0 level to the utmost level.thank u......
THIS WAS THE THING I NEEDED
THIS WAS EXACTLEY WHAT I NEEDED TO UNDERSTAND THE PROGRAM. MANY MANY THANKS TO YOU, DEAR WRITER OF TUTORIAL!
really nice
thanks a million...real good way to learn vb....cheers
Post new comment