A Visual Basic.NET Programming Tour
The first step to learning a new programming language is the same as that of any other activity—building confidence. In this chapter, author James Foxall teaches you how to build a simple, yet functional Visual Basic application. You'll become familiar with some programming lingo, let a user browse a hard drive, display a picture from a file on disk, and learn about the Visual Basic IDE.
Learning a new programming language can be intimidating. If you've never programmed before, the act of typing seemingly cryptic text to produce sleek and powerful applications probably seems like a black art, and you may wonder how you'll ever learn everything you need to know. The answer is, of course, one step at a time. The first step to learning a language is the same as that of any other activity—building confidence. Programming is part art and part science. Although it may seem like magic, it's more akin to illusion; after you know how things work, a lot of the mysticism goes away, freeing you to focus on the mechanics necessary to produce the desired result.
In this hour, you'll complete a quick tour that takes you step-by-step through creating a complete, albeit small, Visual Basic program. I've yet to see a "Hello World" program that's the least bit helpful (they usually do nothing more than print "hello world" to the screen—oh, fun). So instead, you'll create a picture-viewer application that lets you view Windows bitmaps and icons on your computer. You'll learn how to let a user browse for a file and how to display a selected picture file on the screen, both of which are skills that will come in handy in later applications that you create. Creating large, commercial solutions is accomplished by way of a series of small steps. After you've finished creating this small project, you'll have an overall feel for the development process.
The highlights of this hour include the following:
Building a simple, yet functional, Visual Basic application
Letting a user browse a hard drive
Displaying a picture from a file on disk
Getting familiar with some programming lingo
Learning about the Visual Basic IDE
I hope that by the end of this hour, you'll realize just how much fun it is to program using Visual Basic.
Starting Visual Basic.NET
You must be familiar with a few terms before you begin to create programs in Visual Basic:
Distributable Component
- The final, compiled version of a project. Components can be distributed to other people and other computers and do not require Visual Basic to run. Distributable components are also called programs.
Project
- A collection of files that can be compiled to create a distributable component (program). There are many types of projects, and complex applications may consist of many projects, such as a Windows Application project and support DLL projects.
Solution
- A collection of projects and files that compose an application or component.
New Term
Visual Basic.NET is a complete development environment; every tool you'll need to create your Visual Basic projects is accessed from within Visual Basic. The Visual Basic environment is called the IDE, short for Integrated Development Environment, and it's the design framework in which you build applications. To work with Visual Basic projects, you must first start the Visual Basic IDE.
Start Visual Basic.NET now by choosing Microsoft Visual Studio.NET 7.0 from within the Microsoft Visual Studio.NET 7.0 folder on your Start menu.