VISUAL BASIC_6
 

1.  Introduction to IDE and Creating a Sample Project


Integrated Development Environment:

 The working environment in VB is often referred to as the Integrated Development Environment or IDE, because it integrates many different functions such as design, editing, compiling and  debugging  within a  common environment.   Since all our projects are developed only in the IDE,  let us now  have a brief look at its features.    You will be able to understand their uses at the time of building projects.  The VB IDE looks  as shown in the figure 1.


 
Figure 1

Elements of Visual Basic IDE:

     The VB IDE consists of the following elements.

      1. Menu Bar

2. Context Menus

3. Toolbars

4. Toolbox

5. Project Explorer Window

6. Properties Window

7. Object Browser

8. Form Designer

9. Code Editor Window

10. Form Layout Window

11. Immediate, Locals and Watch Windows.

Menu Bar:

Menu Bar displays the commands you use to work with Visual Basic and is located at the top. Besides the standard File, Edit, View, Windows and Help menus, menus are provided to access functions specific to programming such as Project, Format  or Debug.

Context Menus:

Context Menus provide certain short cuts to frequently performed actions.   To open a context menu, click the right mouse button on the object you are using.   The specific list of shortcuts available from  context menus depends on the part of the environment where you click the right mouse button.   For example, the context menu displayed when you right click on the Toolbox lets you display the components dialog box, hide the Toolbox, dock or undock the Toolbox, or add a custom tab to the Toolbox  etc.

Toolbars:

Toolbars provide quick access to commonly used commands in the programming environment and is located below the menu bar.   You click a button on the toolbar once to carry out the action represented by that button.   By default, the Standard toolbar is displayed when you start VB.   Additional toolbars, for editing, form design, and debugging can be toggled on or off from the Toolbars command on the View Menu.    Toolbars can be docked beneath the menu bar or can “float” if you select the vertical bar on the left edge and drag it away from the menu bar.

Toolbox:

Toolbox provides a set of controls that you use at design time to place them on the form and is located on the left side.   In addition to the default controls layout,  you can create your own custom layouts by selecting Add Tab from the context menu and adding controls to the resulting tab.

Project Explorer Window:

The  Project Window lists the forms, and modules in your current project.   To recapitulate, a project is simply a collection of files you use to build your application.

Properties Window:

Properties Window displays the different properties of the different objects, such as size, caption, color etc., which can be set at the design time and located at the right side.

Object Browser:

 The Object browser lists the available objects  in your project, and gives you a way to navigate through your code.   You can use the Object browser to explore objects in VB ,  see what methods and properties are available for those objects, and paste code procedures into your application.

Form Designer:

 The Form serves as the designer window or the container for placing the different controls, graphics and pictures needed for your applications and is located at the center. There can be more than one form or a designer window for a single application.  

Code Editor Window:

 Every form has its own code editor window, where you write the codes for manipulating the objects in the designer window.

Form Layout Window:

The Form Layout Window allows you to position the forms in your application using a small graphical representation of the screen.

Immediate Window:

 The Immediate Window is provided for debugging purposes and is located below the form window.   You can use it in the calculator mode to immediately compute big expressions.

Visual Basic provides a great deal of flexibility, allowing you to configure the working environment to best suit your individual style. You can choose between a single or multiple document interface, and you can adjust the size and positioning of the various Integrated Development Environment (IDE) elements. Your layout will persist between sessions of Visual Basic.

SDI or MDI Interface

Two different styles are available for the Visual Basic IDE: single document interface (SDI) or multiple document interface (MDI). With the SDI option, all of the IDE windows are free to be moved anywhere on screen; as long as Visual Basic is the current application, they will remain on top of any other applications. With the MDI option, all of the IDE windows are contained within a single resizable parent window.

    To switch between SDI and MDI modes

1. Select Options from the Tools menu.

The Options dialog box is displayed.

2. Select the Advanced tab.

3. Check or uncheck the SDI Development Environment check box.

The IDE will start in the selected mode the next time you start Visual Basic.

    or        

Run Visual Basic from the command line with a /sdi or /mdi parameter.

Docking Windows

Many of the windows in the IDE can be docked, or connected, to each other or to the edge of the screen. These include the Toolbox, Form Layout Window, Project Explorer, Properties window, Color Palette, and Immediate, Locals, and Watch windows.

With the MDI option, windows can be docked to any side of the parent window; with SDI they can only be docked beneath the menu bar. Docking capabilities can be toggled on or off for a given window by selecting the appropriate check box on the Docking tab of the Options dialog box, available from the Options command on the Tools menu.

    To dock or undock a window

1. Select the window you wish to dock or undock.

2. Drag the window to the desired location by holding down the left mouse button.

          The outline of the window will be displayed as you drag.

3. Release the mouse button.


 

Copyright © 2001 Selfonline-Education. All rights reserved.