VISUAL BASIC 6 0 1 Introduction VISUAL BASIC
VISUAL BASIC 6. 0 1
Introduction • VISUAL BASIC is a tool that allows you to develop Windows (Graphic User Interface GUI) applications. The applications have a familiar appearance to the user. • VISUAL BASIC is an ideal programming language for developing sophisticated applications for Microsoft windows. 2
• VISUAL BASIC is event-driven, meaning code remains idle until called upon to respond to some event (button pressing, menu selection. . . ). • Visual Basic is governed by an event processor. • Nothing happens until an event is detected. Once an event is detected, the code corresponding to that event (event procedure) is executed. Program control is then returned to the event processor. 3
History of Visual Basic • VISUAL BASIC is evolved from the earlier DOS version called BASIC means “Beginners All purpose Symbolic Instruction Code”. • It has been around for more than 35 years. BASIC was further developed as Visual Basic to make it compatible with today’s environment. • Microsoft created the enhanced version of BASIC, called visual basic. 4
• VISUAL BASIC can create Windows programs whereas BASIC could only create DOS programs. • It means that BASIC programming is done in a text-only environment and VISUAL BASIC programming is done in a graphical environment. 5
Some Features of Visual Basic • Full set of objects - you 'draw' the application. • Lots of icons and pictures for your use. • Response to mouse and keyboard actions. • Clipboard and printer access. • Full array of mathematical, string handling, and graphics functions. • Can handle fixed and dynamic variable and control arrays. 6
• Sequential and random access file support. • Useful debugger and error-handling facilities. • Powerful database access tools. • Active. X support. • Package & Deployment Wizard makes distributing your applications simple. 7
Visual Basic 6. 0 Vs Other Versions of Visual Basic • The original Visual Basic for DOS and Visual Basic For Windows were introduced in 1991. • Visual Basic 3. 0 (a vast improvement over previous versions) was released in 1993. • Visual Basic 4. 0 released in late 1995 (added 32 bit application support). 8
• Visual Basic 5. 0 released in late 1996. New environment, supported creation of Active. X controls, deleted 16 bit application support. • And, then Visual Basic 6. 0 - some identified new features of Visual Basic 6. 0: v Faster compiler. v New Active. X data control object. v Allows database integration with wide variety of applications. 9
v New data report designer. v New Package & Deployment Wizard. v Additional internet capabilities. 10
Graphical User Interface (GUI) VISUAL BASIC makes use of GRAPHICAL USER INTERFACE (GUI) for creating robust and powerful applications. A simple GUI looks like this: 11
• GUI given above shows graphical interaction between user and system. That is why a GUI is an effective mean of making your application user friendly and is the key to creating successful applications. • GUI becomes very popular because users can easily identify things with the help of graphics. • The main advantage of using GUI is that user can interact with application using common sense. Even a laymen user can learn GUI applications easily. 12
Visual Basic Integrated Development Environment (IDE) • VISUAL BASIC IDE (INTEGRATED DEVELOPMENT ENVIRONMENT) is the environment in which its program are written and executed. • IDE is a term commonly used to describe the interface and environment for creating your application. • It is called IDE because you can access all of the development tools that you need for developing an application. 13
Components of VB IDE VISUAL BASIC IDE contains different components. These components are: • Tool Bar • Form Window • Tool Box • Property Window • Project Explorer Window • Menu Bar • Form Layout Window 14
Tool Bar • It provides quick access to commonly used commands in the programming environment. • You click a button on the toolbar to carry out the action represented by that button. • The Standard toolbar is displayed when you start Visual Basic. 15
• You can change toolbar settings by selecting Toolbars option form View menu. • Toolbar can be removed from beneath of the menu bar, if you click on the Left Edge and drag it away from the menu bar. 16
Form Window • Form objects are the basic building blocks of Visual Basic application. • It is the actual window with which a user interacts at the start of application. 17
• Forms have their own properties, events, and methods with which you can control their appearance and behavior. • The Form Window is central to developing Visual Basic applications. • It is the window where you draw your application. 18
Tool Box • You use special tools, called controls, to add elements of a program user interface to a form. • You can find these resources in the toolbox, which is typically located along the left side of the screen. • If the toolbox is not open, display it by using the Toolbox command on the View menu. 19
20
• By using toolbox controls, you can add these elements to the user interface: q q q q q Artwork Labels and text boxes Buttons List boxes Scroll bars File system controls Timers Geometric shapes Data and OLE controls. 21
Property Window • With the Properties window, you change the characteristics (property settings) of the user interface elements on a form. • A property setting is a characteristic of a user interface object. • For example, you can change the text displayed by a text box control to a different font, point size, or alignment. 22
23
• Two views are available: q Alphabetic and q Categorized. • If you are not getting property window on IDE then click on Project Explorer option from view menu. Or, Use key F 4 or Alt+V+W for displaying property window. 24
Project Explorer Window • A Visual Basic program consists of several files that are linked together to make the program run. • The Visual Basic 6. 0 development environment includes a Project window to help you switch back and forth between these components as you work on a project. 25
• The Project window lists all the files used in the programming process and provides access to them with two special buttons: View Code and View Object. • If you are not viewing Project Explorer on IDE then click on Project Explorer option from the view menu. OR, Use Ctrl+R for displaying Project Explorer Window. 26
Menu Bar • It is a horizontal strip that appears across the top of the screen and contains the names of menus. • Menu Bar lists the menus that you can use in the active window. • You can modify the menu bar using the Commands tab of the Customize dialog box. 27
• For that go to the View menu, then select Toolbars. • Now Click on the customize option. OR, You can use key combination Alt+V+T+C for that. • A window will appear like the figure given below: 28
• A list of options will be displayed. A user can make a selection in order to perform a selected action. • Suppose if you want to animate menu options then click on the options in below figure. • OR, Use key combination Alt+V+T+C+O for animation. 29
Form Layout Window • The Form Layout window is a visual design tool. • With it, you can control the placement of the forms in the Windows environment when they are executed. • When you have more than one form in your program, the Form Layout window is especially useful — you can arrange the forms onscreen exactly the way you want. 30
• To position a form in the Form Layout window, simply drag the miniature form to the desired location in the window. 31
• Click on to the Form Layout window option from view menu for displaying above window. • OR, Use Key Combination Alt+V+F for that. • It allows you to visually position your forms. • All forms will be displayed when you place your cursor over a form. • Press the mouse button, and drag it where you want the position of your form. 32
Applications of Visual Basic • VISUAL BASIC is mostly used in application programming. • VISUAL BASIC provides easy to use connectivity with database that is why most of database related software being developed in VISUAL BASIC today. • A simple VISUAL BASIC application works like given in fig: 33
34
• Visual Basic is the most sophisticated tool for developing commercial applications. • Various information systems are implementing in VISUAL BASIC today, these are as follows: q MIS(Management Information System), q EIS(employee Information System), q Inventory control, q ERP(Enterprise Resource Planning), q Web application, q Library Management System Etc. 35
- Slides: 35