Elements of an integrated development environment
Basic's working environment is often referred to as an integrated development environment or IDE because it integrates many different functions, such as design, editing, compilation, and debugging, into a common environment. In most traditional development tools, each function runs as an independent program and has its own interface.
In this section, the following topics will be discussed:
1. Start (VisualBasicIDEvbconStartingVisualBasicIDE) to get up and running.
2. Integrated Development Environment Elements (vbconIntegratedDevelopmentEnvironmentElements) introduces the different components of the IDE.
3. Environment options (vbconEnvironmentOptions) configure Visual Basic to meet personal needs.
Start VisualBasicIDE
When running the Visual Basic Setup program, allows you to place program items in an existing program group, or create a new program group and program item for Visual Basic in Windows. You are now ready to start Visual Basic from Windows.
To start Visual Basic from Windows, follow these steps:
1. Click "Start" on the taskbar.
2. Select "Program" and then select "Microsoft Visual Basic 6.0". -or- Click Start on the taskbar. Select "Program". Use "Windows Explorer" to find the Visual Basic executable file.
3. Double-click the Visual Basic icon. You can also create a Visual Basic shortcut key and double-click the shortcut key. When you start Visual Basic for the first time, you can see the interface of the integrated development environment, as shown in Figure 2.1.
Elements of an integrated development environment
The Visual Basic Integrated Development Environment (IDE) consists of the following elements:
menu bar
Displays the Visual Basic commands used. In addition to the standard "File", "Edit", "View", "Window" and "Help" menus, there are also menus for programming-specific functions such as "Project", "Format" or "Debug".
context menu
Includes shortcut keys for frequently performed operations. Click the mouse button on the object you want to use to open the context menu. The list of special shortcut keys valid in the context menu depends on the context in which the mouse button is clicked. For example, the context menu displayed when you right-click the Toolbox, on which you can choose to display the Parts dialog box, hide the Toolbox, park or hang up the Toolbox, or ” to add a custom tab.
Toolbar
Provides quick access to frequently used commands in a programming environment. Click a button on the toolbar to perform the operation represented by the button. By default, the "Standard" toolbar is displayed after starting Visual Basic. Additional editing, form design, and debugging toolbars can be moved in and out from the Toolbars command on the View menu.
The toolbar can be placed just below the menu bar, or it can be placed as a vertical bar against the left border. If you drag it away from the menu, it can "hang" in the window.
toolbox
Provides a set of tools for placing controls on a form at design time. In addition to the default toolbox layout, you can create a custom layout by selecting Add Tab from the context menu and adding controls to the results tab.
For more information about special controls, see Chapter 3, "Forms, Controls, and Menus" and Chapter 7, "Using Visual Basic Standard Controls." For detailed information on how to add controls in the "Toolbox", please refer to "Adding Controls in the Project" in Chapter 4 "Project Management".
Project manager window
List the forms and modules in the current project. A project is a collection of files used to create an application.
For more information about projects, see Chapter 4, "Management of Projects."
Properties window
Lists the property settings for selected forms and controls. Properties refer to characteristics of an object, such as size, title, or color.
For more information about properties, see "Overview of Properties, Methods, and Events" in Chapter 3, "Forms, Controls, and Menus"
object browser
Lists the objects valid in your project and provides a quick way to navigate your coding. You can use the "Object Browser" to browse objects in Visual Basic and other applications, view the methods and properties that are valid for those objects, and paste the code process into your own applications.
For more information about the viewing process using the Object Browser, see "Finding Object Information" in Chapter 9, "Programming with Objects." For detailed information about using add-ins to extend the Visual Basic programming environment, see "Using Wizards and Add-Ins" in Chapter 4, "Project Management."
form designer
Used as a custom window to design the application's interface. Add controls, graphics, and pictures to your form to create the look you want. Each form in the application has its own form designer window.
For more information about how to add controls to your application, see "Your First Visual Basic Application" later in this chapter. For more information about interface design, see Chapter 6, "Creating the User Interface."
Code editor window
Is the editor for entering application code. Each form or code module of the application has a separate code editor window.
For more information about entering code and using the code editor, see Chapter 5, "Programming Basics."
form layout window
FormLayoutwindow (Figure 2.2) allows the placement of forms in an application using small images that represent the screen.
Immediate, local and watch windows
These additional windows are provided for debugging applications. They are only valid when running the application within the IDE.
For more information about debugging and using the debug window, see Chapter 13, "Debugging Code and Handling Errors."
Note that the functionality of the Visual Basic interface can also be added using programs that call add-ins. Add-ins provided by Microsoft and third-party developers provide features such as source code control that support group development projects.
environment options
Visual Basic offers a great deal of flexibility in configuring the work environment to best suit your personal style. You can choose between single or multiple document interfaces and adjust the size and position of various integrated development environment (IDE) elements. The selected layout will be retained between Visual Basic sessions.
SDI or MDI interface
VisualBasicIDE comes in two different types: Single Document Interface (SDI) or Multiple Document Interface (MDI). With the SDI option, all IDE windows can be moved freely anywhere on the screen; they will be positioned on top of other applications as long as Visual Basic is the current application. For the MDI option, all IDE windows are contained within a resizable parent window.
To switch between SDI and MDI modes, follow these steps:
1. Select "Options" from the "Tools" menu. Displays the Options dialog box.
2. Select the "Advanced" tab.
3. Select or not select the "SDI Development Environment" checkbox. The next time you start Visual Basic, the IDE will start in the selected mode. -or- Run Visual Basic from the command line with the /sdi or /mdi parameters.
dock window
Many windows in an integrated development environment can be connected to each other or docked at the edge of the screen. Including: toolbox, form layout window, project manager, properties window, palette, immediate window, local window and monitor window.
For the MDI option, the window can be parked on either side of the parent window, while for SDI, the window can only be parked below the menu bar. The Connectable feature of a given window can be turned on or off by selecting the appropriate check box on the Connectable tab of the Options dialog box, which can be accessed from the Tools Select the "Options" command on the menu.
To park or move a window, follow these steps:
1. Select the window you want to park or move.
2. Hold down the left mouse button and drag the window to the desired location.
3. The window outline will be displayed when dragging.
4. Release the mouse button.
->