Hello World Application
Hello World Application
The first thing you need to do if you want to learn certain programming language like Visual Basic is to familiarize the IDE. The most popular source code that is being run is the "Hello World".
Any programming language has its own version of "Hello World" Application. To learn more about the list of Hello World Program, visit Wikipedia’s example.
In Visual Basic, there are several ways of showing the Hello World text. You can use a TextBox, a Windows Forms caption, a Console Application, and a lot more. Whatever it is, the important is you know how it works.
In this tutorial, we will use Windows Forms and a TextBox to show the Hello World Text.
Create a New Visual Basic Project
1. From the File menu, click New Project
This will open a new project dialog box as show below:
2. Select Visual Basic under the Project types and click Windows.
3. Select Windows Forms Application from the Templates.
4. Type the name of the project (e.g. Hello World).
5. Click OK.
You will now see one Windows Forms added to your Hello World project.
Add Control into Windows Forms
Drag TextBox control located under Common Controls to Form1.
Next we will set the Text property of the TextBox control.
Select TextBox control in Form1 and type "Hello World" in the properties window.
Now that you have already set the Hello World text, the next thing that you need to do is to save and run the application.
Saving the Project
1. From the File menu, click Save All.
2. Select the Location of the Project and click Save.
Running the Application
After you click the Run button, you will see the following output of your application.
Next thing to do is to build the application for production release.
Building the Application
You can now run the application without the Visual Basic editor on any Windows OS as long as it has the .NET framework installed.
You can copy the files under the Bin >> Release folder.
In my case, it is located under "D:\Websites\Sourcecodester.com\Tutorials\Hello World\Hello World\bin\Release".
Now you know how to create a Project, add a TextBox, change the Text properties of TextBox control, Save the project, Build the project and run the program.
All you need to do now is experiment on how to work with other controls like Label, CheckBox, ComboBox and a lot more.