What is VB(Visual Basic) ?
y Visual Basic is a "visual programming" environment for developing Windows (also

Web now) applications or Graphical application. Visual Basic makes it possible to develop complicated applications very quickly. The programmer designs windows graphically, drags program elements from the Visual Basic Toolbox and writes basic code for each element. Visual Basic is "event-driven" which means that procedures are called automatically when the end user chooses menu items, clicks the mouse, moves objects on the screen, etc.

VB6 is built around on IDE . VB is one of the most popular window software development tool.0 is a Microsoft product with a lineage since 1991. that allow rapid development of user interface and the supporting code. It is sometimes called an event ±Driven language because each object can react to different events such as a mouse click . java etc. Based on ³Basic language´ .y Visual Basic 6. c++ . VB6 is also called object based programming environment . VB was one of the first product to provide a graphical programming environment. . the visual basic approach has become the norm for y y y y y programming language like c. while it has a number of object oriented features . y Since it launch in 1990.

With Visual Basic you can develop Windows based applications and games. y However. You may choose other language (like C++). Visual Basic is much easier to learn than other language (like Visual C++). y y y y y . and yet it's powerful programming language. But y If you want to make a really advanced professional game like Quake 2. that would be much more harder to program . Visual Basic will be probably powerful enough to suit all your application and games programming needs. Visual Basic suits more for application developing than for Games developing.What Is Visual Basic and Why do I need it? Visual Basic is Easy to learn Programming language. y You can create sophisticated games using Visual Basic.

y Visual Basic is not only a programming language but also a true graphical development environment. C++ could be done in hours with Visual Basic. Visual Basic also has the ability to develop programs that can be used as a frontend application to a database system. what could take days to create an application in other programming languages like C. Visual Basic provides many interesting sets of tools to aid us in building exciting applications.Why is Visual Basic popular? y Programmers have undergone a major change in many years of programming various machines. . For example. This environment allows programmers with little programming experience to quickly develop powerful Windows applications. serving as the user interface which collects user input and displays formatted output in a more appealing and useful form.Visual Basic provides these tools to make our life far more easier because all the real hard code is already written for us.

y Visual Basic is very popular for the ease with which it allows the programmer to create nice looking graphical programs with less coding unlike many other languages that take thousands of lines of programmer keyed code. As the programmer works in the graphical environment much of the program code is automatically generated by theVisual Basic program. .

revise. Visual Basic is ideal for developing applications that run on the Windows operating system. VB encourages you to experiment. However.Areas of Use y Using Visual Basic's tools we can quickly translate an abstract idea into a program design that we can actually see on the screen. most of all. correct. Developing applications with VB can be said to be a 3-step approach: y i) Design the appearance of application ii) Assign property settings to the objects of the program iii) Write the code to direct specific tasks at runtime . and network your design until the new project meets your requirements. it inspires your imagination and creativity.

Some of them are listed below: Accounting Business Commerce Consulting Education Law Marketing and Sales Medicine Research Science Many of the things that we do with Visual Basic really aren¶t very basic. it can be accomplished using Visual Basic . if you can imagine a programming task. The Visual Basic language is powerful.y y y y y y y y y y Visual Basic is used to develop applications in a number of different areas.

Because Visual Basic is so popular. News groups and more) that can help you learn the language. There are many good resources (Books. Things that may be difficult to program with other language can be done in Visual Basic very easily. Web sites. We can Use a form and controls to create a user interface. Suitable for Rapid Application Development. In VB . It is Easy to use . . Compare to other languages. You can find the answers to your programming problems much more easily than other programming languages. Visual Basic have the widest variety of tools that you can download on the internet and use in your programs. It is one of High Level lenguage.The advantages of Visual Basic: y y y y y y y y It's simple language.

The disadvantages of Visual Basic: y Visual Basic is powerful language. but it's not suit for programming really y y y y y y sophisticated games. VB is not well documented. VB is not suitable for very large projects which must be maintained over a long period of time. . It's much slower than other languages. VB is not Vendor Independent. VB is not platform Independent . VB is not based on constant Language definition.

It was the first visual development tool from Microsoft.0 that people really discovered the potential of the language. C++. It wasn't until release 2. NET Debuts . Visual Basic wasn't a hit. VB2 Debuts 1993. Below is the order and the approximate year in which a new version of Visual Basic was released: y y y y y y y 1991.0 it had become the fastest-growing programming language on the market.History of Visual Basic Microsoft first released Visual Basic in 1987. VB3 Debut 1996. VB5 Debuts 1998. VB1 Debuts 1992. VB. Pascal and other well-known programming languages. From the start. VB4 Debuts 1997. and with release 3. VB6 Debuts 2001. and it was to compete with C.

editing.0 y Starting the Visual Basic IDE When you run the Visual Basic Setup program. In most traditional development tools. and debugging within a common environment. each with its own interface. . the following topics are discussed: Visual Basic Concepts y Visual Studio 6. compiling. You are then ready to start Visual Basic from Windows. it allows you to place the program items in an existing program group or create a new program group and new program items for Visual Basic in Windows. In this section. each of these functions would operate as a separate program.y Integrated Development Environment (IDE) : The working environment in Visual Basic is often referred to as the integrated development environment or IDE because it integrates many different functions such as design.

y Select Programs. . y Double-click the Visual Basic icon. as shown in Figure 2. y When you first start Visual Basic. you see the interface of the integrated development environment. y You can also create a shortcut to Visual Basic.1. y Use the Windows Explorer to find the Visual Basic executable file. y Select Programs. or y Click Start on the Task bar.0.To start Visual Basic from Windows y Click Start on the Task bar. and double-click the shortcut. Visual Studio and then Microsoft Visual Basic 6.

1 The Visual Basic integrated development environment .y figure 2.

and Help menus.y y y y Visual Basic Concepts Visual Studio 6. Menu Bar Displays the commands you use to work with Visual Basic. View. or add a custom tab to the Toolbox. Besides the standard File. For example. the context menu displayed when you right click on the Toolbox lets you display the Components dialog box. Window. y Context Menus Contain shortcuts to frequently performed actions. . or Debug. dock or undock the Toolbox. The specific list of shortcuts available from context menus depends on the part of the environment where you click the right mouse button. hide the Toolbox. Format. To open a context menu. Edit. menus are provided to access functions specific to programming such as Project.0 Integrated Development Environment Elements The Visual Basic integrated development environment (IDE) consists of the following elements. click the right mouse button on the object you're using.

see "Forms. you can create your own custom layouts by selecting Add Tab from the context menu and adding controls to the resulting tab. see "Adding Controls to a Project" in "Managing Projects. and debugging can be toggled on or off from the Toolbars command on the View menu." For information on how to add controls to the Toolbox. In addition to the default toolbox layout. or More Information To learn more about specific controls." . form design. Toolbox Provides a set of tools that you use at design time to place controls on a form. You click a button on the toolbar once to carry out the action represented by that button. 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.y Toolbars y Provide quick access to commonly used commands in the programming y y y y environment. and Menus" and "Using Visual Basic's Standard Controls. Controls. Additional toolbars for editing. By default. the Standard toolbar is displayed when you start Visual Basic.

" y Object Browser y Lists objects available for use in your project and gives you a quick way to navigate through your code. caption. A project is the collection of files you use to build an application. and Menus. see "Finding Out About Objects" in "Programming with Objects. You can use the Object Browser to explore objects in Visual Basic and other applications. and Events" in "Forms." . see "Managing Projects. or color. see "Understanding Properties.y Project Explorer Window y Lists the forms and modules in your current project. Controls. y For More Information For information on projects. such as size." y Properties Window y Lists the property settings for the selected form or control. y For More Information For information on properties." For details on using add-ins to extend the Visual Basic programming environment. see "Using Wizards and Add-ins" in "Managing Projects. A property is a characteristic of an object. and paste code procedures into your application. see what methods and properties are available for those objects. Methods. y For More Information For more information on using the Object Browser to view procedures.

" Form Layout Window The Form Layout window (Figure 2. graphics. You add controls. A separate code editor window is created for each form or code module in your application.2) allows you to position the forms in your application using a small graphical representation of the screen.y Form Designer y Serves as a window that you customize to design the interface of your y y y y y y y application. see "Creating a User Interface. and pictures to a form to create the look you want. see "Programming Fundamentals." Code Editor Window Serves as an editor for entering application code.2 The Form Layout window . Each form in your application has its own form designer window. see "Your First Visual Basic Application" later in this chapter. For More Information To learn how to add controls to an application. Figure 2. To learn more about designing an interface. For More Information To learn more about entering code and using the code editor.


" y Note You can also add features to the Visual Basic interface by using a program called an add-in. . which are available from Microsoft and third-party developers. which allows you to support group development projects. Locals. see "Debugging Your Code and Handling Errors. y or More Information To learn more about debugging and using the debug windows. They are only available when you are running your application within the IDE. can provide features like source code control. and Watch Windows y These additional windows are provided for use in debugging your application.y Immediate. Add-ins.

y SDI or MDI Interface y Two different styles are available for the Visual Basic IDE: single document interface (SDI) or multiple document interface (MDI). and you can adjust the size and positioning of the various Integrated Development Environment (IDE) elements. as long as Visual Basic is the current application. With the MDI option. allowing you to configure the working environment to best suit your individual style. y y y y . Your layout will persist between sessions of Visual Basic.Visual Basic Concepts Visual Studio 6. With the SDI option. all of the IDE windows are free to be moved anywhere on screen.0 Environment Options Visual Basic provides a great deal of flexibility. You can choose between a single or multiple document interface. all of the IDE windows are contained within a single resizable parent window. they will remain on top of any other applications.

Project Explorer.The IDE will start in the selected mode the next time you start Visual Basic. Docking Windows Many of the windows in the IDE can be docked.The Options dialog box is displayed. and Watch windows. . Properties window. With the MDI option. Select the Advanced tab. to each other or to the edge of the screen. or connected. 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. and Immediate. Locals. available from the Options command on the Tools menu.y y y y y y y y y To switch between SDI and MDI modes Select Options from the Tools menu. Form Layout Window. These include the Toolbox. or Run Visual Basic from the command line with a /sdi or /mdi parameter. with SDI they can only be docked beneath the menu bar. windows can be docked to any side of the parent window. Color Palette. Check or uncheck the SDI Development Environment check box.

y Release the mouse button. . y The outline of the window will be displayed as you drag. y Drag the window to the desired location by holding down the left mouse button.To dock or undock a window y Select the window you wish to dock or undock.



we will see how the different tools available in the visual basic¶s IDE can be used. menu bar and toolbar constitute the user interface.y Elements of User Interface: A program¶s user interface refers to the part of the program that the user sees and interacts with. The different controls available on the toolbox. . The Visual Basic tools falls in three categories: y Intrinsic controls/ Standard controls y ActiveX controls y Insert able objects. As the application¶s interface is developed.

Check Box: Displays a True/False or Yes/No option. Text Box: Use to display message and enter text. Command Buttons: Used to carry out the specified action when the user chooses it. . This allows the user to select an item from the dropdown list box. or type in a selection in the Text Box. It displays text or y y y y y y y acts as a visual container for other controls. List Box: Displays a list of items from which a user can select one. Combo Box: Contains a Text Box and a List Box. Option Button: Option Button control which is the part of an option group allows the user to select only one option even it displays multiple choices. Frame: Serves as visual and functional container for controls.y Following are the list of standard controls and their functionality y Pointer: Provides a way to move and resize the controls form. y Picture Box: Displays icons/bitmaps and metafiles.

Image: Used to display images such as icons. Timer: Executes the timer events at specified intervals of time. bitmaps and metafiles. Data: Enables the use to connect to an existing database and display information from it. File List Box: Displays a set of files from which a user can select the desired one. Dir List Box: Allows the user to select the directories and paths. displays and manipulate data from other windows based applications. OLE: Used to link or embed an object. But less capability than the Picture Box. which are displayed.y HScrollBar and VScrollBar: These controls allow the user to select a value y y y y y y y y y y within the specified range of values. Label: Displays a text that the user can not modify or interact with. . Line: Used to draw straight line to the form. Drive List Box: Displays the valid disk drives and allows the user to select one of them. Shape: Used to add shape to a form.

Sign up to vote on this title
UsefulNot useful