PSU CS 106 Computing Fundamentals II Visual Basic Program Creation HM 1/3/2009.

Slides:



Advertisements
Similar presentations
An Introduction to Visual Basic Terms & Concepts.
Advertisements

Information System Design Lab 5&6. User Interface Design.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Using VB with MS Applications R. Juhl, Delta College.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Apply Sub Procedures/Methods and User Defined Functions
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
A First Program Using C#
05/09/ Introducing Visual Basic Sequence Programming.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Microsoft Visual Basic 2005: Reloaded Second Edition
CIS 338: Creating ActiveX Controls Dr. Ralph D. Westfall March, 2003.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
An Introduction to Visual Basic
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Introduction to the Visual Studio.NET IDE (LAB 1 )
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction to Visual Basic.NET Your First Visual Basic.NET Application.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Chapter 2 –Visual Basic, Controls, and Events
Creating Projects in JCreator Computer Science 40S.
Chapter Two Creating a First Project in Visual Basic.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
CS130 Project 1 A simple VB application ("project" or program): user enters amount of sales then clicks the "Calculate button", the application displays.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter 3 - VB.NET by Schneider1 Chapter 3 – Fundamentals of Programming in VB.NET Part I VB.NET Controls VB.NET Events.
1.
PSU CS 106 Computing Fundamentals II VB Declarations HM 5/4/2008.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
1 CS 106 Computing Fundamentals II Chapter 210 “Adding Controls to User Forms” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
1.Begin by opening VB 2.Click New Project or the icon Hello World Tutorial NOTE: depending on your version of VB – the images might be slightly different.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Visual Basic Fundamental Concepts
Chapter 1: An Introduction to Visual Basic 2015
Visual Basic Code & No.: CS 218
Chapter Topics 15.1 Graphical User Interfaces
An Introduction to Computers and Visual Basic
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
An Introduction to Computers and Visual Basic
An Introduction to Visual Basic
Visual Basic..
CIS16 Application Development Programming with Visual Basic
An Introduction to Computers and Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

PSU CS 106 Computing Fundamentals II Visual Basic Program Creation HM 1/3/2009

2 © Dr. Herbert G. Mayer Agenda Assumptions & Preparation VB Terminology A VB Project Hello World Student Repeat Input & Output Student Repeat

3 © Dr. Herbert G. Mayer Assumptions & Preparation Have computer with Microsoft ® Operating System Similar steps apply to other OSes, but not addressed here Visual Basic (VB) or newer-- is installed With a VB icon, ready for a double-click Have reference text from which to study, e.g. D. Schneider’s An Introduction to Programming Using Visual Basic 2005 –Giving you a mechanism to build a VB project –To Create a VB program –To Run and debug VB program You can learn the syntax rules of VB language proper You understand relationship program to visual Interface Initial difficulties are caused by not understanding the mechanical steps of project creation and program execution, as opposed to understanding the Basic language

4 © Dr. Herbert G. Mayer VB Terminology nameMeaning projectIs VB program to edit, debug, run and rerun; has screens for output, buttons to activate event-sub, text boxes for input, etc. Toolbox (left side)List of ~10 VB command groups, e.g. “Command Controls” Main area (mid)Large Windows field, holding Form1 and output space Form1 (in main area)Defined window area in main area, representing modules of main program; holds buttons and text boxes Properties (right side) For selected field, shows list of all attributes, such as r/w/ color, size, font type, font size, location, language etc. buttonnamed VB field on VB Form, used to activate sub msgboxPop-up box showing generated output Event procedure: Sub keyword Similar to procedure/function. Associated with a button, has predefined formal parameter list, named after associated button Button buttonWhen clicked, creates a button on Form1 TextBox buttonWhen clicked, creates a text box on Form1 for input to program F4 keyActivates properties window F5Tries to run a program, compile is hidden, debug program if failure occurs Alt F4Ends program execution, ends debugging

5 © Dr. Herbert G. Mayer VB Terminology: Toolbox & Main Area

6 © Dr. Herbert G. Mayer VB Terminology: Properties

7 © Dr. Herbert G. Mayer VB Terminology: Main VB

8 © Dr. Herbert G. Mayer A VB Project: Create New Project Click on VB icon on desktop – Start Page opens Click on File, top left – box with file options opens Click on New – Project & File options open Click on Project – New Project Window opens Pay attention to Name-field and Location-field Recommend: You select a better project name than WindowsApplication1 You see the VB Start Page with the new project So you see on the screen l2r : –Toolbox on the left side of the screen –Main Area in the middle –And Properties on the right side of the screen –Headed by new project name

9 © Dr. Herbert G. Mayer A VB Project: Use Previous Project Click on VB icon on desktop – Start Page opens Click on Recent Projects project name of your choice –List is populated with prior project names –One or more You get a VB Start Page with selected project So you see on the screen l2r: –Toolbox on the left side of the screen –Main Area in the middle –And Properties on the right side of the screen –Headed by new project name

10 © Dr. Herbert G. Mayer A VB Project: Start Page

11 © Dr. Herbert G. Mayer A VB Project: New Project Window

12 © Dr. Herbert G. Mayer A VB Project Every button is associated with an Event Procedure –Sub with formal parameter list for –sender As System.Object’ IDE capitalizes 1 st letter –e As System.EventArgs’ of all keywords –Both value parameters; explained later –Clicking on button 1 st time creates skeleton of event procedure! Generally, each text box is associated with an Event Procedure –But input text (and converted result) can be referenced anywhere else too in VB source program –Method to do so, is to use: TextBox1.Text Main program is effectively Form1 with buttons and text boxes Actual VB program also has functions and procedures that can be called, with parameters, and repeatedly To compile, execute, debug: click F5

13 © Dr. Herbert G. Mayer Hello World

14 © Dr. Herbert G. Mayer Hello World

15 © Dr. Herbert G. Mayer Hello World

16 © Dr. Herbert G. Mayer Student Repeats: Hello World

17 © Dr. Herbert G. Mayer Input & Output Next project –prompts user for numeric input –Then reads the input –Finally performs computation and –Outputs the computed numbers Needs 3 items, generates 1 –Button to prompt for number –Text box to read number from (i.e. stdin file in Unix) –Button to compute and produce output –A fourth item is created: MsgBox for output (i.e. stdout in Unix)

18 © Dr. Herbert G. Mayer Input & Output D

19 © Dr. Herbert G. Mayer Input & Output

20 © Dr. Herbert G. Mayer Input & Output

21 © Dr. Herbert G. Mayer Student Repeats: Input & Output