Go Back   CodeCall Programming Forum > Software Development > Tutorials > VB Tutorials
Register Blogs Search Today's Posts Mark Forums Read

VB Tutorials Visual Basic Tutorials and Code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-09-2009, 07:27 AM
Vswe's Avatar
Code Slinger
 
Join Date: Apr 2009
Location: Uppsala, Sweden
Age: 16
Posts: 8,536
Vswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond repute
Send a message via MSN to Vswe Send a message via Skype™ to Vswe
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-11-2009, 10:40 AM
Jordan's Avatar
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 24,556
Jordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to all
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan Send a message via Yahoo to Jordan
Re: VB for Beginners - Part 1 - Introduction

Not bad. How about some screenshots?
+rep
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-11-2009, 10:47 AM
Vswe's Avatar
Code Slinger
 
Join Date: Apr 2009
Location: Uppsala, Sweden
Age: 16
Posts: 8,536
Vswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond repute
Send a message via MSN to Vswe Send a message via Skype™ to Vswe
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-11-2009, 12:49 PM
Xav's Avatar
Xav Xav is offline
Code Slinger
 
Join Date: Mar 2008
Location: The North Pole
Posts: 13,210
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-11-2009, 01:31 PM
Vswe's Avatar
Code Slinger
 
Join Date: Apr 2009
Location: Uppsala, Sweden
Age: 16
Posts: 8,536
Vswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond repute
Send a message via MSN to Vswe Send a message via Skype™ to Vswe
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-11-2009, 02:47 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 24,556
Jordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to all
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan Send a message via Yahoo to Jordan
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-11-2009, 03:10 PM
Xav's Avatar
Xav Xav is offline
Code Slinger
 
Join Date: Mar 2008
Location: The North Pole
Posts: 13,210
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-11-2009, 03:22 PM
Vswe's Avatar
Code Slinger
 
Join Date: Apr 2009
Location: Uppsala, Sweden
Age: 16
Posts: 8,536
Vswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond repute
Send a message via MSN to Vswe Send a message via Skype™ to Vswe
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-11-2009, 03:23 PM
Xav's Avatar
Xav Xav is offline
Code Slinger
 
Join Date: Mar 2008
Location: The North Pole
Posts: 13,210
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 05-11-2009, 03:32 PM
Vswe's Avatar
Code Slinger
 
Join Date: Apr 2009
Location: Uppsala, Sweden
Age: 16
Posts: 8,536
Vswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond reputeVswe has a reputation beyond repute
Send a message via MSN to Vswe Send a message via Skype™ to Vswe
Re: VB for Beginners - Part 1 - Introduction

Yes, that's true. So you mean that you always should name your application for TestApplication?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
beginners, vb.net, visial basic



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Introduction to Form Submission PART II Xav PHP Tutorials 11 10-25-2008 01:20 PM
Introduction to Form Submission PART I Xav PHP Tutorials 7 10-14-2008 03:09 PM
CSS Part 1: Introduction Lop Tutorials 3 09-15-2008 06:24 AM
Introduction -- Part 2 MeTh0Dz|Reb0rn Introductions 13 07-23-2008 08:08 PM
Adventures in F# - F# 101 Part 9 (Control Flow) Kernel News 0 05-05-2008 08:43 AM


All times are GMT -5. The time now is 10:30 AM.


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0