1 / 12

Introduction to Visual Basic

Introduction to Visual Basic. 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

ling
Download Presentation

Introduction to Visual Basic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 Window • The largest window • This form will become a window at run time • Toolbox Window • contains controls (grapical objects) you can add to a form • examples: text box, command button, check box, etc. • 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 (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 Window • use this window to set properties of a selected control • Code 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

More Related