Visual Basic for beginners: Learn Visual Basic Express

An sample of "splash-screen". The splash-screen displayed is the one that shows while Visual Basic 2010 is being loaded.
An sample of "splash-screen". The splash-screen displayed is the one that shows while Visual Basic 2010 is being loaded. | Source

Bit of background and basics

Many of Hub readers here, meets everyday with a single word like "VBasic" or phrase like "VBasic runtime..." or even "VBasic runtime error". So, what is the "VBasic" ?

-Word "VBasic" comes from two words : Visual and Basic giving VBasic.

Visual Basic is an program language. People, usually programers, use it to program an software. Every software is developed (made by) some kind of "program language". The most used ones are : Visual Basic, Java, PHP, HTML, HTML+ , C++, Delphi, and more... The Android programing is the latest way of mobile programing, so it's meant for mobile platforms (mobile phones, smartphones...).

While Visual Basic is considered as one of the "simplest developer tool" to make programs, executable on 32bit and 64bit platforms, usually Windows (because, programing is "form-based" form=Window) it can develop major projects, for enterprise companies. From "Hello Word" kind of programs, trough the programs for tracking the market to the programing of Operating Systems (OS) - Visual Basic is everywhere, and it is easy to use.


Learning basics

To know to program in Visual Basic, You have to know English well. That is a must. Literally, this program language is "talking to You" while You program on it. For example there are program codes like: If something.does then something.what happens ; end if. This is a logical way of programing and it is my way of explanation how the basic programing goes in Visual Basic.

Of course, there are much, much, much more tricky and puzzled things than this, but I gave You an idea how everything works. As in every program language, You have variables and their usage is huge, they can be treated "as integer" or ... You'll see, and learn.

On this page (click on blue marked), You will find plenty of useful informations about Visual Basic itself and programing language. And on this page, You can DOWNLOAD Your first Visual Basic 2010 Express Developer Tool !(when page is opened, click on Install Now.)

Now, let's get started. When installation process is done, and everything is fine configured (there isn't something much to configure to be honest) - You are ready to start Your very first program! Isn't this exciting or what ?

As always, I will go with the pattern of learning "HELLO WORLD" project first. Start up the Visual Basic 2010 Express. After splash screen, You will have several options - even it's own tutorial.(not very useful)


The Main Screen

This is the main screen of Your new exciting tool that You'll use to make some cool programs.
This is the main screen of Your new exciting tool that You'll use to make some cool programs. | Source
This is the picture of "Properties Window" on the down right side of window.
This is the picture of "Properties Window" on the down right side of window. | Source
Picture of "Toolbox" , containing all needed objects and tools You need for Your project, such as: buttons, labels, progress bar, radio buttons, lists, text box...and MANY more!
Picture of "Toolbox" , containing all needed objects and tools You need for Your project, such as: buttons, labels, progress bar, radio buttons, lists, text box...and MANY more! | Source
Project Explorer window. Shows everything that makes one project. Forms, classes...etc...
Project Explorer window. Shows everything that makes one project. Forms, classes...etc... | Source

Starting "HELLO WOLD" Project : Creation

On main window, as displayed, choose the "New Project". One-click on it.

When second window opens, the "template" window that offers You per-configured templates, choose "Windows Form Application"! Then click OK. On bottom part of the window, You will have the option to enter the optional name of the project, but it's o.k to leave it like that.

And wholaaaaaaaa! There You are! You are watching the window that billions of programers watch every day, while they develop the most sophisticated software for our usage, and we don't even know it.

We start with, basic screen. You can see that You already have "Form1" displayed and created, with, on down right side it's properties - if You click once on form. This "Form1" will be Your future window. Now, on the left side - You can see the tools, or "things that You can insert into project". We will need : 1 button and 1 label. So, double click on "Button" (on left side) and double click on "Label" also on left side of the screen.

Now, You've noticed that when You double clicked on the "Button" the button, on "Form1" was created with "Button1" text on it. Same with "Label", just the text on it is "Label1" , which marks the actual name of the object inserted. NOTICE: TEXT ISN'T SAME AS THE NAME, BUT, WHEN YOU INSERT THE OBJECT FOR FIRST TIME, THE "TEXT" VALUE WILL BE THE DEFAULT NAME OF THE INSERTED OBJECT!

Next move is to click on the form, and You will see the "re-size" points being displayed on each corner of form. Click on the down-right, and make the form look like rectangle. It's easy. When You've done it, move the "Button1" object to the right side of the form, and the "Label1" leave on left side of rectangles form.

Click once, to select the object You want to edit/program. Click on the "Button1", and on the right side where the properties window is, change value of "Text" from "Button1" to "Click To See". Remember: when You change something in the "properties" filed, you change the "value" of it!

The button should now contain no more the "Button1" caption, but, "Click To..." ! Probably there isn't enough space for whole phrase ( Click To See ) , so, same as with form, re-size the button, on the way You want - but enough to see the TEXT - "Click To See". Remember: THE NAME OF THE BUTTON WILL STILL BE "BUTTON1" WHEN YOU PROGRAM.

What we forgot, and what is very important, in order to have a program that will display "HELLO WORLD - I MADE IT!" label on click, is to click on the label "Hello World I Made It" and on the properties menu, scroll down, find the Visible and set value to "False". On this way, when You run the application, the label won't be visible until "You say so" - until You click the Button!

Now, click on the "Label1". On the right side, in the properties window, select "Text" , and change the value to " HELLO WORLD - I MADE IT! ". Of course, in both cases, You don't need the quote marks! Which is good, and make things a bit easier and faster.





Starting "HELLO WOLD" Project : Programing

Double click on the "Click To See" button. It will open the window where You enter Your program codes, it is actually the field where the programing starts.

Between "Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click" and "End Sub" insert next:


Label1.Visible = True


You have noticed that we didn't insert the "If Button1.Click code..." Why? - Because we already gave an sign to Visual Basic by double clicking on it, that we want action related to click.I've underlined, the code that shows where Visual Basic says to computer, do "this" on CLICK.



And now You need to hit the green "play button" on upper menu. That "play button", will try to run Your project. If project is written well, without any syntax error - it will run it, and You will see it as You've ran the .exe application. And that's it!

The only thing, that I would add is an exit button, that would shut down the application, but since You automatically have the minimize, maximize and close buttons on the right top angle of window - than You probably don't need it. But if You want so, create a new button, change the TEXT to "EXIT" , and double click to it. After double clicking enter:
"Form1.Close" , and that's all.


YOU HAVE MADE YOUR FIRST .EXE APPLICATION IN VISUAL BASIC.

This is how it should look !

This is how the program should look in Visual Basic, fully programed and designed. :)
This is how the program should look in Visual Basic, fully programed and designed. :) | Source

Want to continue?

Do You want me to write more hubs about Visual Basic programing, and make an "hub-session" of step-by-step hubs for programing? Would that be something that might been interesting to You ?

  • Yes, it would be intersting - and I am ready for next lesson.
  • No, I am not interested in programing.
  • Yes, it would be interesting - but I'm personaly not interested in it.
See results without voting

More by this Author


Comments 3 comments

superpipoy profile image

superpipoy 4 years ago

Visual Basic is the best programming language I have ever learned. This is a very interesting hub. But sad to say, Visual Basic nowadays are not too very useful since we are now evolving in a web-based technology. I think I'll go ahead on learning HTML programming deeply. But all in all you really have a very interesting and useful hub information. I should have seen this a long time ago.


days leaper profile image

days leaper 3 years ago from england

Thanks. This is a great resourcve for vb programming. I will follow you on hubpages.

Can you tell me how to keep textbox information in a textbox after user changews form without having to save it to disk. Obviously it would have to be in RAM and recallrd when user goes back to that form but how?

vb.net 2003


lafamillia profile image

lafamillia 3 years ago from Soutcentral Europe Author

@days leaper

- You should be able to make .input (keyboard) room on your ram.

I suppose that you have installed the MSDN tools, right?

For example this code will remeber the dataset you've inserted, but you MUST have RMDB or SQL type of database inserted/created.

Public Sub Page_Load(ByVal sender As Object, ByVal args As EventArgs) Handles MyBase.Load

If Not IsPostBack Then

If Session("Address") Is Nothing Then

EnterUserInfoPanel.Visible = True

UserInfoPanel.Visible = False

Else

EnterUserInfoPanel.Visible = False

UserInfoPanel.Visible = True

SetLabels()

End If

End If

End Sub

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working