1 Course Title: Visual Basic Programming Topic: Introduction to programming Languages (Visual basic 6.0) Lecturer: Mahamud Ahmed Jimale, BsIT, MsCs, CCNA, CEH University Of Hargeisa Faculty Of ICT & Distance Learning
2 What is a Programming language? A programming language is an artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine.
3 What is a Programming language?
4 Low level Vs High-level Programming Languages
5 1st Generation: Machine Language (1940s) Binary ( ), Hex (9B) 2nd Generation: Assembly Language (early ’50s) Used in HW instruction sets (e.g., LOD X, ADD Z, STR Y) 3rd Generation: High-level Languages (mid ‘50s) Procedural (e.g., input x, y=x+z, output y) 4th Generation: Modern tools (late ‘70s) (e.g., SELECT UserID, LastName FROM Clients WHERE State=“PA” GENERATIONS OF PRGRAMMING LANGUAGES
6 Logical Patient Perceptive (observant) At least moderately intelligent Enjoys an intellectual challenge Who can be a successful programmer?
7 Visual Basic is a programming language used to create Windows based applications. Visual Basic is based on the old BASIC (Beginner’s All- Purpose Symbolic Instruction Code) language What is Visual Basic?
8 GUI development environment for developing Windows applications. Object based development is possible using Class modules. Rapid Application Development (RAD). Can create COM components such as ActiveX Controls, DLLs and EXEs. Many internet development possibilities. Has an excellent integrated Help facility and Books Online. Good debugging facilities. Features of Visual Basic
9 A shorter learning curve and development time than C/C++, Delphi or even PowerBuilder. Allows for rapid application development. Is excellent for business applications. Allows you to create ActiveX controls. Allows you to reuse third-party, as well as your own, controls and components. Is object-oriented in nature. It is not a complete OOP language, but it is getting closer. Can integrate with the Internet both server and client- side. Visual Basic Advantages
10 Runtime distribution requirements are larger than C/C++. Not as much functionality as C/C++ in getting to features of the OS. Visual Basic Disadvantages
11 Visual Basic Learning Edition Visual Basic Professional Edition Visual Basic Enterprise Edition Versions of Visual Basic
12 Standard EXE ActiveX EXE ActiveX DLL ActiveX Control ActiveX Document DLL ActiveX Document EXE IIS Application DHTML Application Visual Basic Application Types
13 Visual Basic Application Types
14 1.Create the interface. 2.Set properties for controls. 3.Write code. Three Steps to Creating an Application
15 Projects Forms Controls Code Modules Class Modules User Controls Property Pages User Document (ActiveX Document) IIS Applications DHTML Applications Resource Files Visual Basic Application Components
16 A Visual Basic Application
17 Visual Basic InteIDE Run button Stop Button Pause
18 The ToolBox
19 The Project Window (or Project explorer window)
20 The Code editor window
21 Open File menu, select New Project (or just press CTR-N) Select StandardEXE project, then Click OK Click the new form windows. In the properties windows, change the name property, to frmHello, and caption property to Hello application. Add a button control to the form. Change the name property to command button to cmdHello, and caption property to &Display Double click the command button to display the code editor window. Between the two lines that appear type your code eg” Msgbox “Hello, this is a new application!” Save the new form with fromHello.frm, save the project with Hello.vbp name Run the project by clicking the run button, or by pressing F5 Click the display button (A dialog box with “Hello” message should appear Creating a New Project, Hello project
22 VB Object Naming Conventions
23 Creating a New Project, Hello project
24 Class exercise, design, code and run the following application Code for Go button Code for end button Shape control Text Box label
25 Question & Answer