Jump to content


Photo

Visual Basic Coding Tutorial 1


  • Please log in to reply
No replies to this topic

#1 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 31 March 2012 - 09:14 PM

To begin your journey of learning Visual Basic we will discuss what Visual Basic is and how it can be used. We will also be learning about which basic programs you need to start using Visual Basic.
Here are some of the terms defined for you:
What is Visual Basic?
-Visual Basic is a coding language that is used to create basic programs such as launchers for video games, basic installers, and web browsers.

What programs do you need to work with Visual Basic?
-There are quite a few programs that allow you to use/write Visual Basic. The main program we will be using it a program called “Microsoft Visual Studio 2010 Express Edition”.

To begin we will go over how to get your copy of “Microsoft Visual Studio 2010 Express Edition”
1- Go to www.microsoft.com. Then underneath the Products tab you will want to click “Visual Studio”.

2- Once clicked you should be at the home page for all the Visual Studio products. The next step is to go underneath the Products tab and click “Visual Basic Express”.

3- Now all you have to do is press “Install Now - English”. Once installed you can open up the program and take a look around. This is your new workspace!

We will start with a basic application that will have a button that when pressed will bring up a message box saying “Hello World!”
Start by going up to File-New-Project… and select “Windows Forms Application” at the bottom name it Hello World! and press Ok. Now in your tool box you should see an option called button. Drag it into your form. (the box in the middle of the application) A button should appear. We will name out button by right clicking on it and pressing properties. Look for the Text field and replace Button1 with Hello World! then double click your button and a new window should appear with the following code in it:

Public Class Form1

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

	End Sub
End Class

In between the Private Sub Button1_Click and the End Sub type this:

Messagebox.show(“Hello World!”)

So the code should look like:

Public Class Form1

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Messagebox.show(“Hello World!”)

	End Sub
End Class

Then go up to debug and under debug click Start debugging and your own application should pop up with your button in it. Click you button and a window should open with Hello World! Printed in the center. Congratulations you have made your first application! This concludes the first tutorial on Visual Basic. The second tutorial should be available in a few days.

Edited by Dragon Rider, 31 March 2012 - 09:16 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users