Tuesday, March 6, 2012

How to start programing in visal basic 2010

Introduction

Visual Basic is a free set of tools that windows developers at any level can use to create they're custom application using basic and expert settings.

1.Creating our first application

Before creating a new application we need to make a new project, you need to click and select new project
New project dialog will appear :

The dialog box offers you seven types of projects that you can create. As we are going to learn to create windows applications, we will select "Windows Forms Application".
At the bottom of this dialog box, you can change the project name (default "WindowsApplication1") to some other name you like, for exampe, MyFirstProgram. After you have renamed the project of your liking, click "OK" to continue. The following Windows will appear. It consists of an empty form, the common controls toolbox, the solution explorer and the properties.
Now we will create or first program, lets add 1 button and change the text of it "Properties window-Text" and change what every you like ex. "Message box"

Now for the coding part we will make that when you push the button it will show you a messagebox notification.
Double click the button and key in the following code at the source code window as show below.

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("This is my first application :]")
End Sub


Now run your first application. After you pushed the button you can see the messge poping out
with the worked we writed before.
Today we learned how to make a message box. I hope you enjoyed the tutorial. :]

No comments:

Post a Comment