Help - Search - Members - Calendar
Full Version: Visual Basic Hello World!
Darkside_RG > Technical Discussions > Guides/How To > Coding Guides
subman
Visual Basic Basics

Today I am going to show you how to create a simple Hello World! application. I will be using Visual Studio 2008 for this tutorial.
Open Visual Studio 2008 and create a new project.
Under the Visual Basic category, we are going to select Windows then Windows Forms Application.

http://submanslair.com/vbtut1/newproj.PNG

Under name, insert VBTut1.

You now come to a screen with a blank template of a Window.

http://submanslair.com/vbtut1/newform2.PNG

Now what we are going to is click the window, make sure it is selected, and go to the right hand bottom corner window called Properties.

http://submanslair.com/vbtut1/prop3.PNG

Now find the row with the title “Text”. The text next to that should say Form1. Change it by clicking Form1 and type VBTut1. This sets the title of the window.
Go to the left hand side and click the Toolbox. Under “Common Controls” double-click the one called button. This will create a button on your form. You can now drag this Button any where you want it to go. Ill put mine in the middle.

http://submanslair.com/vbtut1/toolbox4.PNG

http://submanslair.com/vbtut1/button5.PNG

Now lets test and see what our application is going to look like. Go to the toolbar where the “File” and “Edit” are located. Find the green play button. When you click this, the application is then compiled into a executable file. (.exe) It will then also run the program for you.

http://submanslair.com/vbtut1/run6.PNG

http://submanslair.com/vbtut1/run7.PNG

What happens when you click the button? Nothing! That’s because we have not included the proper code to make it happen! Click the “X” in the corner of the running program. Now that we are back at the regular designing screen, click on the button that we have created. Go to your properties window and find the “Text” box again. Enter the word “Go”.

http://submanslair.com/vbtut1/go8.PNG

Now double click the button that we have created. It will now open up the code screen.

http://submanslair.com/vbtut1/code9.PNG

Now type:
CODE
MsgBox("Hello World!")


http://submanslair.com/vbtut1/hello10.PNG

Now save this and run your program. Click your Go button and there you go! :)

http://submanslair.com/vbtut1/preview11.PNG


I take ALL credit for the creation and compiling of this tutorial.
More coming soon!

Thank you! Comments and questions appreciated.
Sp4
Thank you for the guide subman
subman
No problem, I'm creating another very soon :)
Sp4
Links broken as the host is no longer live.




Closed
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.