Skip navigation

Here are some programming examples for beginners (Advanced users are down this page)
Please not i’m not using Visual Basic 6 but i’m using Visual Basic 2008/.NET!
All images can be found at the ‘Image Examples’ tab.

Skill Acquired = 0 (Your first program! :D)
As first we want to open up a project for a normal windows application, goto file > new project > select ‘Windows Forms Application’ fill in the name you want, i use ‘Hello World’ and press ok.
Ok if you made a new project it should look like this:
This is what it should look like when you created a new project<– this window is called a ‘form’ my form name is ‘form1’.
In the solutions Explorer (the tree view explorer where all forms, classes, modules etc. are located [maby that sounds to difficult, but when you don’t understand it, no problem, because it’s a little bit to early to talk about classes and modules.) is the ‘form1’ located as ‘form1’ ofcourse, to change: rigthmouse click > rename, if you clear the whole name note this:
always put in the solution explorer a ‘.vb’ behind the name (example, wrong: ‘FirstProgram’,right : ‘FirstProgram.vb’)
Now when you done this, double click in the form so you will get to the code of the application, there you find (if you done everything right):
Private Class (Your project name)
Private Sub (formname)_load(ByVal sender As System.Object, ByVal e As System.EventArgs)…

End sub
End Class
So this is the main Build of your program so go ahead and press the green play button. Visual Basic will now enter ‘Debug Mode’, This means that it will run the application inside vb, so you can use your program but not share the so called ‘.exe’ file, .exe is an extension for windows, exe means ‘Exicutible’ and run as a proces in your system, so you don’t need vb for running the .exe file. But i’ll come back on this later. Now we want to make this program show a message box in his startup. to do this you goto the sub: (formname)_load([and some other crap here, but it’s not important here, i just want to show you that _load means ‘This sub will be exicuted on startup’.])
And type between The Private sub ‘(formname)_load’ and ‘End Sub’ The code for the message box. The code for a message box is pretty easy, Type in:
Msgbox(“Between Those Quote’s a text that you want to show, i use ‘Hello World'”, ‘Here you have some options like wich style the box must be, like an error or just an information box style’ , “Again between those quote’s type the title that you want”) <-And close with the ‘)’ also its important that you have to seperate you options with an ‘,’ [thats a comma :D] also every text you want to input must be between these quote’s (“) [now i use seperators to show you that sign :D]. Press run
and it should look like this:
This is the result of 1 line of coding
Now click on ‘Save all’ or this image:
When you done that, goto Build and Select Build (project name). The .exe file will be builded in:
(the directory you save the file to)/(project name again)/bin/release/(project name again)
Now you can send this application to everyone you like :D. That was it for this program :D. Hope you liked it :D. More Comming Soon!



    • Jesse
    • Posted 10 November, 2008 at 11:35 am
    • Permalink


    • M.A.Sami
    • Posted 10 November, 2008 at 3:32 pm
    • Permalink

    Great work dude
    u helped when i needed it great work
    Keep Rocking

  1. Good site, but add the coding for the programs in as well.

  2. you are cool

    • taik
    • Posted 5 June, 2011 at 3:51 pm
    • Permalink

    korang ni taik la

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: