Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)

Similar presentations


Presentation on theme: "Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)"— Presentation transcript:

1 Introduction to Visual Basic

2 What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey) designer Tools (command buttons, list boxes, text boxes, option buttons, etc.) –A programming language Qbasic like –All within an IDE (Integrated Development Environment) design interface, set properties, add code, debug

3 Topics Starting VB The main VB screen Event-Driven Programming Writing a Visual Basic program Running a Visual Basic program Saving a project Opening an existing project

4 Starting VB Start | Microsoft Visual Studio | Visual Basic 6.0 DblClicking on VB shortcut desktop icon From My Computer Right click on Start to invoke Explorer DblClick on Program Files|DblClick on Microsoft Visual Studio|DblClick on Vb98|DblClick on Vb6

5 The Main VB Screen Design Time vs. Run Time Form WindowForm Window –The largest window –This form will become a window at run time Toolbox WindowToolbox Window –contains controls (grapical objects) you can add to a form –examples: text box, command button, check box, etc. Project Explorer (Project Window)Project Explorer (Project Window) –lists modules (form, standard, etc.) that make up project –can view code/form of selected module

6 The Main VB Screen The Main VB Screen ( con’t) Menu Bar/Toolbar Window –Menus of: File, Edit, View, Project, Format, Debug Run, Query, Diagram, Tools, Add-Ins, Window, Help –Toolbar: set of Command buttons; convenience tool for programmer; point mouse to find function Properties WindowProperties Window –use this window to set properties of a selected control Code WindowCode Window –where code is entered

7 Event-Driven Programming Procedural (linear) programming vs. Event- driven Programming Events (at run time) –single mouse click of command button, form, option button, etc., ( CLICK event for that control) –pressing most keys (KEYPRESS event) –double mouse click (DBLCLICK event for that control) Event Handlers (event subroutines) Private cmdMybutton_Click( ) End Sub

8 Writing a Visual Basic Program Design interface Set properties Write code

9 Running a Visual Basic Program Either –Click run button on Toolbar –Press F5 key –Click Run|Start on Menu Run and test your project

10 Saving a Project Click on the Toolbar button 5th from left (the one with the diskette icon) or click on the File|Save Project menu A dialog box will appear asking you for the physical name of your form file(s), and where you want to save it A 2nd dialog box will appear after you take care of the 1st, asking you for the project name If you have only one form file, the name should be the same for the form file and the project file Saving the project again, after the first time will not invoke dialog boxes

11 Opening an Existing Project Click on the Toolbar button 4rd from left (the one with the folder icon) or click on File|Open Project menu or use the hot key Ctrl/O A dialog box will appear requesting the name of the project and its location

12 Summary Components of Visual Basic –GUI, programming language, IDE Entering the IDE –menu bar, toolbars, toolbox, form window Event Driven Programming Developing a VB Project –design interface –set properties (design time) –write the code (do the programming) –test (run) the project Save the project Open an existing project Print the interface, properties, and code


Download ppt "Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)"

Similar presentations


Ads by Google