270 likes | 543 Vues
University Of Hargeisa Faculty Of ICT & Distance Learning. Course Title: Visual Basic Programming Topic: Introduction to programming Languages (Visual basic 6.0) Lecturer : Mahamud Ahmed Jimale, BsIT, MsCs, CCNA, CEH. What is a Programming language?.
E N D
University Of Hargeisa Faculty Of ICT & Distance Learning Course Title: Visual Basic Programming Topic: Introduction to programming Languages (Visual basic 6.0) Lecturer: Mahamud Ahmed Jimale, BsIT, MsCs, CCNA, CEH
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. 2
GENERATIONS OF PRGRAMMING LANGUAGES 1st Generation: Machine Language (1940s) Binary (1010 1011), 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”
Who can be a successful programmer? • Logical • Patient • Perceptive (observant) • At least moderately intelligent • Enjoys an intellectual challenge 6
What is Visual Basic? 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 7
Features of Visual Basic • 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. 8
Visual Basic Advantages • 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. 9
Visual Basic Disadvantages •Runtime distribution requirements are larger than C/C++. •Not as much functionality as C/C++ in getting to features of the OS. 10
Versions of Visual Basic • Visual Basic Learning Edition • Visual Basic Professional Edition • Visual Basic Enterprise Edition 11
Visual Basic Application Types • Standard EXE • ActiveX EXE • ActiveX DLL • ActiveX Control • ActiveX Document DLL • ActiveX Document EXE • IIS Application • DHTML Application 12
Three Steps to Creating an Application 1. Create the interface. 2. Set properties for controls. 3. Write code. 14
Visual Basic Application Components • Projects • Forms • Controls • Code Modules • Class Modules • User Controls • Property Pages • User Document (ActiveX Document) • IIS Applications • DHTML Applications • Resource Files 15
Visual Basic InteIDE Run button Stop Button Pause 17
The ToolBox 18
Creating a New Project, Hello project • 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 21
Creating a New Project, Hello project 2 3 1 4 5 23
Class exercise, design, code and run the following application label Code for Go button Text Box Shape control label Code for end button Text Box 24