Results 1 to 10 of 10

Thread: Visual Basic Tutorial- Number 1

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Posts
    220

    Post Visual Basic Tutorial- Number 1

    Visual Basic is one of the most stright forward and easiest languages to learn. If you are a first time programmer or have programmed before, visual basic is a great choice. Unlike C/C++ the code in visual basic is more like English than it is code. You just type in the name of an object and the property that you want to edit then the value of the property. The only thing required to learn visual basic is Microsoft Visual Basic 5 or higher or Microsoft Visual Studio

    When you double click on a object such as a text box, the code window appears. From here you will see the name of the object and preceded by "Sub Procedure" This is where you type in your code. The only code that may be outside of this Procedure is Varible Declarations and API calls. To edit the properties of an object you would use something like this objectname.property = setting For some things the = may be left out, but I will tell you when that is ok. Place a text box on the form then double click on the form. The form load procedure comes up. To change the text of the textbox when the form loads you place
    textbox1.text = "Text you want displayed" in the form load procedure. To change the font size you would use textbox1.font.size = 12 In Visual Basic you do not need to declare a variable before you assign it a value, though doing so may cause errors. To declare a variable you put the word Dim followed by the varible name followed by the type you wish you declare it as. Dim temp as string would create a varible named temp which would hold strings. The different varible types are String, Integer, Double, Boolean, long, single, or variant (which is any of the types) To place the text of a textbox in a varible you would use the statement- Varible = Textbox1.text To add two strings together you use the character & for example the following procedure would place the text of textbox1 and textbox two in textbox3

    Private Sub form1_load()
    Dim temp1 as string, temp2 as string
    Temp1 = textbox1.text
    temp2 = textbox2.text
    textbox3.text = temp1 & temp2
    End Sub


    No two varible or object names may be the same and visual basic does not distinguish between Capital and lowercase letters. I know this first tutorial did not teach much but there is still alot more to come. The next tutorials will not have as much introduction and will get straight to the point. If you would like any of my tutorials in advance or would like any help you may e-mail me at This E-mail address. here are a few good links to try if you want to start learning visual basic.

    http://www.a1vbcode.com
    http://www.codearchive.com
    http://msdn.microsoft.com
    http://www.vbforums.com
    http://www.codeguru.com
    http://www.mvps.org/vbnet/
    http://www.developerfusion.com
    http://www.planet-source-code.com/vb/

  2. #2
    er0k
    Guest
    nice beginning tut.

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Posts
    220
    Thanks!
    [gloworange]And then it happened... a door opened to a world... rushing through the phone line like heroin through an addict\'s veins, an electronic pulse is sent out, a refuge from the day-to-day incompetencies is sought... a board is found. \"This is it... this is where I belong...\" I know everyone here... even if I\'ve never met them, never talked to them, may never hear from them again... I know you all...[/gloworange]

  4. #4
    Woo Hoo! I made VB do something! Thanks that was the first tutorial I found that actually produced a result.
    Why take the stairs when you can just fall?

  5. #5
    Senior Member
    Join Date
    Jan 2003
    Posts
    220
    No problem...alot more to come...Ill try to make another in t he next few days. It will be alot better.

  6. #6
    Junior Member
    Join Date
    Mar 2003
    Posts
    16
    nice tutorial, on a side note, liberty basic is another easy language/dialect to learn, since its a visual basic offshoot. i believe you can find it at www.libertybasic.com
    Mark was here

  7. #7
    Senior Member
    Join Date
    Jul 2002
    Posts
    315
    Limpster I swear if I didn't know VB already you pointed me in the right direction to start learning.

    Nice tut man. Make it bigger and maybe most people wouldn't need a starting VB book.

    Guidance...

    [edit]Got it kind of late but had to show my appreciation for good work[/edit]
    - The mind is too beautiful to waste...
    Cutty


  8. #8
    Junior Member
    Join Date
    Jan 2003
    Posts
    28
    that is a great beginning tutorial. Thanks.

  9. #9
    Senior Member
    Join Date
    Jan 2003
    Posts
    220
    Hey no problem!
    [gloworange]And then it happened... a door opened to a world... rushing through the phone line like heroin through an addict\'s veins, an electronic pulse is sent out, a refuge from the day-to-day incompetencies is sought... a board is found. \"This is it... this is where I belong...\" I know everyone here... even if I\'ve never met them, never talked to them, may never hear from them again... I know you all...[/gloworange]

  10. #10
    Senior Member
    Join Date
    Oct 2003
    Posts
    234
    Hey, if anyone out there wants to program in VB, you can get a free VB .Net compiler from Microsoft. Go to http://msdn.microsoft.com/downloads/...xml&frame=true and wait to be redirected. Download the .Net framework if you don't already have it and the SDK. The SDK comes with a command-line compiler for VB .Net. It is a large download (over 100 Mb) but well worth it. VB .Net is a bit more like Java than the original VB, but still is very easy to learn (It was the language that I learned first). For more free compilers, I recommend http://www.thefreecountry.com/. Good tut, by the way!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •