Understanding VB.NET Development

5:06 AM / Posted by Alagan /

At the bottom of the screen, there are two buttons: "New Project" and "Open Project". To get started, click the "New Project" button. When you do, you'll see this dialogue box appear:


If you look in the Name textbox at the bottom, you'll see it says "WindowsApplication1". This is the default name for your projects. It's not a good idea to keep this name. After all, you don't want all of your projects to be called "WindowsApplication1", "WindowsApplication2", etc. So click inside this textbox and change this Name to the following:
My First Project
Keep the Location the same as the default. This is a folder inside of your "My Documents" folder called "Visual Studio Projects". A new folder will then be created for you, and its name will be the one you typed in the "Name" textbox. All of your files for your first project are then saved in this folder.
Click the OK button, and the Visual Basic NET design time environment will open.
In the Visual Basic NET design time environment, the first thing to concentrate on is that funny grey square with all the dots on it. That's called a form. It's actually the pretty bit of your programme, the part that others will see when they launch your masterpiece. Granted, it doesn't look too attractive at the moment, but you'll soon discover ways to lick it into shape. Here's what it looks like:



In case you're wondering what those little dots are for, they are there purely for your benefit. They allow you to align things like textboxes and labels with a degree of precision. They won't appear when you run the form. If you don't believe me, try this:
•From the menu bar, click Debug
•From the drop down menu, click Start
•Alternatively, press the F5 key on your keyboard
•Your programme is launched
Congratulations! You have now created your very first programme. It should look like this:


As you can see, all of the dots are gone!
Click the Red X on the form to stop it from running. You will then be returned to the form with the dots on it.
If you compare the first form with the one above, you'll see they look quite different. That's because the one above is actually a real programme, something you could package and sell to unsuspecting village idiots.
So what's going on? Why the two different views? Well, Visual Basic has two distinct environments, a Design environment and a Debug environment. Design Time is where you get to play about with the form, spruce it up, add textboxes, and buttons, and labels (and code, of course ); Debug is where you can test your programme and see how well it performs. Or doesn't perform, as is usually the case.
But don't worry about the terminology, for the time being. Just be aware that there's a two step process to VB programming: designing and debugging.
So, let's get on and do some designing! Before we can start designing a form, though, we need some tools. And where are tools kept? In a toolbox!

Labels:

0 comments:

Post a Comment