Tuesday 4 September 2012

VB Lesson -1 Introduction to VB 6.0

What is Visual Basic 6.0?
Visual Basic is a tool that is used by more number of developers than any other tool. Visual Basic has been the choice of developers for various good reasons. So many small and big companies use Visual Basic for developing various types of applications.  One of the key factors that contributed to the success of Visual Basic is its ease of use.

When Windows Programming (writing programs that run on Windows OS) was very tough and was confined only to a few people who were good in C and C++, Visual Basic hit the market and changed the way one would look at windows programming. Visual Basic made windows programming so simple, even a novice started writing one or two programs for windows in Visual Basic.

What you can do with Visual Basic 6.0?
Since then Visual Basic has grown considerably. The following are the areas that are supported by Visual Basic 6.0.

Standard Windows Application
Simple to complex windows applications can be developed in Visual Basic. Visual Basic provides access to all system components such as printer and clipboard. Visual Basic allows developer to use reusable components, such as ActiveX controls. And developers have always cheered it.

Visual Basic creates standard .EXE file that you can distribute and deploy on any machine. VB allows developer to access windows API, which gives all the power of windows.

Database Application
Visual Basic allows you to create front-end portion of Client/Server applications, and application servers in three-tier client/server applications. You can access any database using ODBC and OLEDB interfaces.

ActiveX Component
Visual Basic allows you to create reusable software components based on ActiveX technology.
 Internet Application
Visual Basic allows you to develop application that can run on Internet and Intranet. Support for Internet application has been enhanced in Visual Basic 6.0 by adding two new project types – DHTML application and IIS application.

Next, we will understand various editions of Visual Basic.

Visual Basic Editions
Visual Basic is available in three versions, each geared to meet a specific set of development requirements.

The following are the three editions and what they provide to developers. The editions are discussed in the order of features.

Learning Edition
Allows programmers to easily create powerful applications for Microsoft Windows and Windows NT. It includes all intrinsic controls, plus grid, tab, and data-bound controls.
Professional Edition
Provides a full-featured set of tools for developing solutions for others. It includes all the features of the Learning edition, plus additional ActiveX controls, the Internet Information Server Application Designer, 
integrated Visual Database Tools and Data Environment, Active Data Objects, and the Dynamic HTML Page Designer.

Enterprise edition
Allows professionals to create robust distributed applications in a team setting. It includes all the features of the Professional edition, plus Back Office tools such as SQL Server, Microsoft Transaction Server, Internet Information Server, Visual SourceSafe, SNA Server, and more.
Starting Visual Basic IDE
Visual Basic provides IDE (Integrated Development Environment) which provides developers all the tools they need to develop applications.

To start Visual Basic from Windows:

1.      Click Start on the Task bar.
2.      Select Programs.
3.      Select Microsoft Visual Studio 6.0 and then Microsoft Visual Basic 6.0

When you start Visual Basic IDE, you are prompted to select the type of project - more on this later in this chapter.

Components of IDE
Visual Basic’s IDE has a collection of components. Each component has a specific task. For example, Project Explorer is used to display the components of the project. And properties window allows you to view & change properties.

The following are the components available in Visual Basic IDE.

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

Context Menus
Contain shortcuts to frequently performed actions. To open a context menu, click the right mouse button on the object you're 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.

Context menu is also called as popup menu.
Toolbars
Provide quick access to commonly used commands in the programming environment. 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 Visual Basic. 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
Provides a set of tools that you use at design time to place controls on a form. In addition to the default toolbox 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
Lists the forms, modules and other components of the current project. A project is a collection of files, which you use to build an application.

Properties Window
Lists the property settings for the selected form or control. A Property is a characteristic of an object, such as size, caption, or color.

Object Browser
Lists objects available for use in your project and gives you a quick way to navigate through your code. You can use the Object Browser to explore objects in Visual Basic and other applications, see what methods and properties are available for those objects, and paste code procedures into your application.

Form Designer
Serves as a window that you customize to design the interface of your application. You add controls, graphics, and pictures to a form to create the look you want. Each form in your application has its own form designer window.

Code Editor Window
Serves as an editor for entering application code. A separate code editor window is created for each form or code module in your application.  Code window contains two dropdown list boxes, One for the list of objects in the form and another for available events of the selected object.
Form Layout Window
The Form Layout window (Figure 1.1) allows you to position the forms in your application using a small graphical representation of the screen.  
Immediate, Locals, and Watch Windows
These additional windows are provided for use in debugging your application. They are only available when you are running your application within the IDE.
Environment Options
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 (I recommend this for beginners); 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.







No comments:

Post a Comment