Overview of Developing Applications with Visual Basic Express
This topic provides an overview of Visual Basic Express, a program for creating applications that use the Visual Basic language. Just as a program like Microsoft Outlook provides a variety of tools for working with e-mail, Visual Basic Express is a toolkit for accomplishing a wide variety of programming tasks.
If you are new to programming, you may want to complete the Visual Basic Guided Tour, a set of lessons designed to teach you the basics, and then return to this topic. To start the tour, see Creating Your First Visual Basic Program.
Visual Basic Express makes developing an application easy—most of the time the process consists of the following steps:
Create a project. A project contains all the files necessary for your application, and it stores information about your application. For more information, see Step 1: Create a Project in Visual Basic. Sometimes an application will contain more than one project, for example, a Windows Application project and one or more Class Library projects. Such an application is called a solution, which is just another name for a group of projects.
Design the user interface. You do this by dragging various controls, such as button and text boxes, onto a design surface known as a form. You can then set properties that define the appearance and behavior of the form and its controls.
For applications that have no user interface, such as class libraries or console applications, this step is not required.
Write the code. Next you will have to write the Visual Basic code that defines how your application will behave and how it will interact with the user. Visual Basic Express makes it easy to write code, providing features like IntelliSense, auto-completion, and code snippets. For more information, see Step 4: Add Visual Basic Code.
Test the code. You will always want to test your application to make sure that it behaves the way that you expect it to. This process is known as debugging. Visual Basic Express has debugging tools that make it easy to find and fix errors in your code interactively. For more information, see Step 5: Run and Test Your Program.
Distribute the application. Once your application is complete, you can install the resulting program on your computer or distribute it and share it with others. Visual Basic Express uses a new technology known as ClickOnce Publishing that enables you to easily deploy an application by using a wizard, and to automatically provide updated versions of the application if you later make changes. For more information, see Distributing a Program.
At first glance, the user interface for Visual Basic Express, also known as the Integrated Development Environment or IDE, may seem unfamiliar, but after you learn your way around, you will find that it is easy to use. The following sections describe parts of the IDE that you will use the most. You can also learn more about the IDE in Introduction to the Visual Basic Express IDE.
When you first open Visual Basic Express, you see that most of the IDE is filled with the Start Page window. The Start Page contains a clickable list of your recent projects, a Getting Started area with links to important Help topics, and a list of links to online articles and other resources. If you are connected to the Internet, this list will be updated regularly.
On the right-hand side of the IDE, you see the Solution Explorer window, as shown in the following illustration. It is initially blank, but this is where information about your project, or groups of projects known as solutions, will be displayed. For more information, see Exploring Your Solution: Using Solution Explorer.
On the left-hand side of the IDE, you see a vertical tab marked Toolbox. It is also initially blank, but as you work it will be filled up with items that can be used for the task you are currently working on. For more information, see Rummaging Through the Toolbox.
Across the top of the IDE are a menu bar and a toolbar. The available menus and toolbar buttons change based on your current task—take some time to explore and see what choices are available. You can also customize the menus and toolbar to match your personal preferences. You customize the toolbar by clicking the Tools menu and then clicking Customize. You can then rearrange commands or add a new toolbar. Across the very bottom of the IDE is a status bar that displays Ready. As you work in the IDE, the status bar changes, displaying messages related to your current task. For example, the status bar shows information about the progress of a project you are building.
When you open or create a project, the appearance of the IDE changes into design mode. The IDE in design mode is shown in the following illustration. This is the visual part of Visual Basic where you design the appearance of your application.
This topic provides an overview of developing Window Forms applications by using Visual Basic Express, but you can also create Windows Presentation Foundation (WPF) applications in Visual Basic Express. The features described in this topic are available in WPF applications, but there are additional features, such as the XAML window. For more information, see Creating the Visual Look of Your Program: Introduction to Windows Presentation Foundation.
In design mode, the Start Page is covered by another window known as the Form Designer, which is basically a blank canvas that represents the user interface for your application. Notice that the Start Page is still available by clicking its tab above the Form Designer.
When the Form Designer is visible, the Toolbox contains many controls (representations of buttons, text fields, grids, and so forth) that can be added to the form and arranged as you like. For more information, see Windows Forms Designer.
You will also notice that a new window, the Properties window, appears underneath the Solution Explorer window. This is where you will set the various properties that define the appearance and behavior of the form and its controls. For more information, see Setting Properties: Using the Properties Window.
By default, the Task List window at the bottom of the IDE isn't shown, but it provides a location where you can keep track of tasks that have to be done or make notes when you are programming. For more information, see Task List (Visual Studio).
If you double-click a form or control, a new window called the Code Editor opens. This is where you write the actual code for your application. More than just a text editor, the Code Editor uses a technology known as IntelliSense to help you write code by providing relevant information as you type. For more information, see Smart Coding: Using IntelliSense to Help You Write Code and Visual Basic-Specific IntelliSense.
For some types of projects, such as Class Library projects that have no user interface, the Code Editor is shown instead of the Form Designer.
When you run or debug your application, the IDE changes into run mode. The application itself is started, and an additional window related to debugging appears. While in run mode, you cannot make changes in the Form Designer, Properties window, or Solution Explorer, but you can change your code in the Code Editor.
In run mode, a new window known as the Immediate window appears at the bottom of the IDE. If you put the application into break mode, you can query values and test code in the Immediate window. Break mode is shown in the following illustration. For more information, see Immediate Window.
Additional windows for watching the value of variables, viewing output, and other debugging tasks can be viewed at run time by selecting them from the Debug menu.
Other Important Windows
There are many additional windows that you may encounter in the IDE, each geared to a specific programming task. Some of the more common ones are in the following list.
The Error List window appears at the bottom of the IDE if incorrect code is entered or other errors occur at design time. For more information, see Error List Window.
The Object Browser window is used to examine the properties, methods, and events for any object that can be used in your application. For more information, see Object Browser.
The Project Designer is used to configure properties for your application. This includes resources, debugging behavior, deployment settings, and much more. For more information, see Introduction to the Project Designer.
The Database Explorer enables you to view and use existing databases or create and design new ones. For more information, see Data Connections in Server Explorer/Database Explorer.
The XAML window appears at the bottom of the IDE if you are creating a WPF application. For more information, see Designing a User Interface for a WPF Application (Visual Basic).
Visual Basic Express enables you to customize the IDE by rearranging the window layout, choosing which windows are displayed, adding or removing menu commands and toolbar buttons, and much more. To learn more about customizing Visual Studio, see Customizing the Development Environment on the MSDN Web site.
As you work in Visual Basic Express, help is always just a key-press away. Whether you are in the Code Editor or any other window, pressing the F1 key displays the Help topic most closely related to what you are doing at the time. For example, if you are in the Code Editor and the cursor is on the keyword Inherits, the Help browser is opened and a topic that describes the use of the Inherits statement is displayed.
The Help files that are included with Visual Basic Express are a subset of the MSDN Library for Visual Studio Express Editions, which is in turn a subset of the full MSDN Library. If you are connected to the Internet, you can access any Help topic in the full library. If you do not have online access or you chose not to install the MSDN Library for Visual Studio Express Editions, some Help topics may not be available.
Help can also be started from the Help menu, and you can find the topics you are looking for by using the Contents or Index windows or the Search tab. For more information, see Help on Help (Microsoft Document Explorer Help).