Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 297,793 times

Contents

Related Categories

Visual Basic Tutorial - Getting Started

Getting Started

Now that you have bought your copy of Visual Basic, whatever its edition, we can take our first look at where you will be spending the next 10 years of your life! (on your PC anyway) I am going to assume that you have successfully installed your copy - this does not usually pose any problems.

Double-click on the Visual Basic icon, and after a little while you will be greeted with the New Project screen. From here, you can then create a new VB project, open an existing one, or re-load one you have recently opened. For the sake of this tutorial, select 'Standard EXE' and click Open. And there you go, your new VB application - or at least an application that displays an empty form. In VB, any dialog that a user is shown is known as a form; when you click save, and a save dialog appears, that is a form. When you type the text in a Word document, or open the options dialog, or anything else, that is a form too!

Before we start doing anything, we need to do something that anyone (with any sense!) who regularly uses Microsoft applications does - save your work! To do this, click the Save icon on the toolbar. You will then be prompted for two filenames. The first is a location for the Form. All good programmers use a 'naming convention'. This basically means that the programmer will use a standard format for all files, or controls, or anything else. Therefore, before naming the file, we want to stick to this convention. These can vary, but normally they follow these two rules:

- Use uppercase letters for the start of each word - spaces are not allowed for names when programming! Some programmers also use a _ (underscore). For example, if I wanted to name something 'my first form', it would be named My_First_Form.
- Add three letters before the name, so that you can instantly recognise what it is. When programming, you end up using an awful lot of names for different things. Naturally, because the things we are naming can be different sorts of things, we need to be able to tell what sort they are, without having to trawl through our code to find out. How do we do this? Using three meaningful letters (or sometimes one, if a programmer wants to have a really hard time coming up with different letters).

In this case we are saving a form, so three letters that are often used are frm. Consequently, as this is an example form, we put the letters 'frm' and 'Example' together, getting 'frmExample'. Enter this in the first Save As dialog, and click Save. The next dialog that appears is for saving the Project file. For projects, we normally use 'prj' as our three letters, so save this one as 'prjMy_First_App'. (In case you are wondering what App is, it is an abbreviation of Application).

James first started writing tutorials on Visual Basic in 1999 whilst starting this website (then known as VB Web). Since then, the site has grown rapidly, and James has written numerous tutorials, articles and reviews on VB, PHP, ASP and C#. In October 2003, James formed the company Developer Fusion Ltd, which owns this website, and also offers various development services. In his spare time, he's a 3rd year undergraduate studying Computer Science in the UK. He's also a Visual Basic MVP.

Comments

  • Re: [30] Complete VB Beginners Tutorial

    Posted by pcmenegusso on 06 Jun 2008

    what's "grammer" anyway? and who's needing it here?

  • Re: beginner...

    Posted by HartTechService on 27 May 2008

    No offense, but you might want to brush up on your English grammer skills first.  "We'll gonna"= We will gonna or going too??????  This just makes no sense.  "We are ...

  • beginner...

    Posted by Tessa07 on 13 Jun 2007

    Hi evry1..
    I take IT course, n we'll gonna use VB for nxt semester.1st n 2nd semester we already have C n C++,so  i hope any1 here can help me out..TQVM..

  • New to VB.net

    Posted by asingh9 on 08 Sep 2005

    Hi,
    I have been using Visual Basic for one year. Now, I want to switch to VB.net as it is the latest technology. I am totally confused how should I go about doing this. Could you tell me the name of ...

  • Student edition

    Posted by eric2358 on 10 Aug 2005

    You may not be able to comile your code into an executable that would be portable, but your code can be copied into notepad files and kept for later use/reuse.