+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 10 of 21

Thread: VB for Beginners - Part 1 - Introduction

  1. #1
    Moderator Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe's Avatar
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Age
    16
    Posts
    8,763
    Blog Entries
    5

    VB for Beginners - Part 1 - Introduction

    Hello everyone. These tutorials is made for someone who want to start learn programming or just have started with VB.Net since that is what I'm going to teach you. You don't need any experience at all.





    Well, let's get started. VB.Net is a very good language for a beginner, it looks like English and is easy to use.

    First you're going to need Visual Basic. It's where you'll write your programs, you can find a link Under Downloads/Comunity/MS Downloads in the top menu of this forum.



    After you have installed Visual Basic and then started it, you will come to the Start Page. Click File in the menu and select New Project... or you can simply just press Ctrl+N on your keyboard. Now you will see a new window asking you what template you want to use for your program.
    We're going to use "Windows Forms Application", make sure it's selected. Then we're going to select a name for our project.
    Note: This is not the name of the program, just the project name.
    I name mine "TestApplication". Then Prees OK.


    Now we'll come to the design view of our project. As default you have the layout of the program in the middle. This is how the program looks like. In the design view it's drag-and-drop editing. You just move things with the mouse and resize them and so on.




    But before we continue we'll need to rename our form. It's good to learn this right from the beginning: "The name of an object should tell what it is and what it is for."
    So we want to rename Form1 (this is the form you can see in the middle, a program can be made of more then on form) to MainForm. This is so you (by only seeing the name) know it's a form and that it's our main one.

    You maybe thinks it isn't so important to have good name, why can't I just have Form1,Form2 and Form3? Well, in programs with a few items you can't remember what everything does, and it's best to learn it the right way from the beginning.

    To change the name of our form click on Form1.vb in the menu in the upper-right corner. In this menu you can see everything in your project (and even the whole solution, but you don't need to think about that).
    Then go to the menu below the other menu ans change File Name from "Form1.vb" to "MainForm.vb". In this other menu you can change the properties of the selected object.





    You maybe have noticed that it still stands Form1 on the form in the middle. Thats because the text of the form is still "Form1". Click on the form in the middle.
    Now you will see a long list in the properties menu. Now we're going to change some values here. Change Text to "My First Program".




    If you want to see your program you can press F5. It's not so much to see though since it's just an empty form.
    Save you project by clicking save all under file in the top menu. The first time you'll need to select the name, it's just to press ok since we already have chosen the name.



    In the next Part we'll work with items and some simple code.
    Take care.

  2. #2
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: VB for Beginners - Part 1 - Introduction

    Not bad. How about some screenshots?
    +rep

  3. #3
    Moderator Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe's Avatar
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Age
    16
    Posts
    8,763
    Blog Entries
    5

    Re: VB for Beginners - Part 1 - Introduction

    Thanks... Maybe I should add some picture. I planned to upload part 2(I have currently made to part 4) when this was confirmed but now I have it on wrong computer.

  4. #4
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: VB for Beginners - Part 1 - Introduction

    Quote Originally Posted by Vswe View Post
    So we want to rename Form1 (this is the form you can see in the middle, a program can be made of more then on form) to MainForm. This is so you (by only seeing the name) know it's a form and that it's our main one.
    I disagree with this. What about standard naming conventions? Any professional will recommend naming your main form frmMain, in the same way a text box containing your postcode should be txtPostcode.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  5. #5
    Moderator Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe's Avatar
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Age
    16
    Posts
    8,763
    Blog Entries
    5

    Re: VB for Beginners - Part 1 - Introduction

    Quote Originally Posted by Xav View Post
    I disagree with this. What about standard naming conventions? Any professional will recommend naming your main form frmMain, in the same way a text box containing your postcode should be txtPostcode.
    How can you disagree with a argument which is agreeing with what I said? The frm shows it's a form and the txt show that it's a textbox.

  6. #6
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: VB for Beginners - Part 1 - Introduction

    He is stating the frm instead of Form. Many .NET books and teachers preach this standard but there is no right or wrong when it comes to naming conventions.

    Posted via CodeCall Mobile

  7. #7
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: VB for Beginners - Part 1 - Introduction

    Indeed there is not, but from personal experience I have learnt that:

    1) Using the same "frm" extension for forms makes things a huge amount easier to manage in code.
    2) Putting the type of control at the start of the name instead of at the end is far preferable for coding, especially in projects (like this one) that use Microsoft's Visual Studio Express IDE. The reason for this is IntelliSense - when typing a reference to a form object, you need only type "frm" and the entire name of the form comes into view. The other way round, you would need to memorise the name of each form that you have in your project in order to call it up for manipulation.

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  8. #8
    Moderator Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe's Avatar
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Age
    16
    Posts
    8,763
    Blog Entries
    5

    Re: VB for Beginners - Part 1 - Introduction

    Xav, you must have understood what I wrote wrong, I wrote:

    Quote Originally Posted by Vswe View Post
    "The name of an object should tell what it is and what it is for."
    This part doesn't say you should name it Form, just that you should name it something so you know it's a form.

  9. #9
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: VB for Beginners - Part 1 - Introduction

    Yes, this part certainly doesn't say you should name it Form.

    But if you read the next sentence you wrote, it says that "we want to rename Form1 (this is the form you can see in the middle, a program can be made of more then on form) to MainForm".

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  10. #10
    Moderator Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe has a reputation beyond repute Vswe's Avatar
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Age
    16
    Posts
    8,763
    Blog Entries
    5

    Re: VB for Beginners - Part 1 - Introduction

    Yes, that's true. So you mean that you always should name your application for TestApplication?

+ Reply to Thread
Page 1 of 3
1 2 3 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Introduction to Form Submission PART II
    By Xav in forum PHP Tutorials
    Replies: 11
    Last Post: 10-25-2008, 12:20 PM
  2. Introduction to Form Submission PART I
    By Xav in forum PHP Tutorials
    Replies: 7
    Last Post: 10-14-2008, 02:09 PM
  3. CSS Part 1: Introduction
    By Lop in forum Tutorials
    Replies: 3
    Last Post: 09-15-2008, 05:24 AM
  4. Introduction -- Part 2
    By MeTh0Dz in forum Introductions
    Replies: 13
    Last Post: 07-23-2008, 07:08 PM
  5. Replies: 0
    Last Post: 05-05-2008, 07:43 AM

Posting Permissions

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