VAT Calculator program Controls Properties Code Results.

Slides:



Advertisements
Similar presentations
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Advertisements

GUI Testing. High level System Testing Test only those scenarios and outputs that are observable by the user Event-driven Interactive Two parts to test.
Chapter 8 - Visual Basic Schneider1 Chapter 8 Sequential Files.
Chapter 8 - Visual Basic Schneider1 Chapter 8 Sequential Files.
Chapter 8 - Visual Basic Schneider1 Chapter 8 Sequential Files.
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
MS-Access XP Lesson 5. Creating a Query with Expression Builder Eg. Consider the following table. Table Name: Overtime Fields & Data types: Emp No (Number),
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Sep-05 Slide:1 ActiveX Controls in VB ActiveX Controls in VB6.
BTEc unit 12 software development
3/9/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Week 2.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
InvEasy (Project1) Please use speaker notes for additional information!
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Programming Examples to Accompany Structure Topic Please use speaker notes for additional information!
Clearly Visual Basic: Programming with Visual Basic 2008
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Computer Science 112 Fundamentals of Programming II Command Buttons and Responding to Events.
CS0004: Introduction to Programming Project 1 – Lessons Learned.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Class Average Application Introducing the Do...Loop While and Do...Loop Until.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Standard Grade Programming using VB 1 Programming Visual Basic.
3.9 to  Also refer to as Program  Contains set of instructions that tells the computer how to perform specific task.  Each line of code is referred.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
1 Advanced Computer Programming Lab Calculator Project.
Class 2 Remote Instruction Review of Working with Buttons EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure.
Pay Example (PFirst98) Please use speaker notes for additional information!
Word Processor Version.2. Methods Visual Basic is –Object Oriented –Event Driven Objects –Properties –Methods.
Visual Basic I/O Programs (ProjRead1, ProjRead2, ProjWrite1, ProjPay) Please use speaker notes for additional information!
SUPPLIER MODULE User’s Guide. Step 1. Click Files Step 2. Click Supplier.
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.
Word Processor Version.01 EME 4411 Week 5. The Scroll Bars.
Slide 1 Controls v Control naming convention –Label: lblName –Command Button: cmdName –Text Box: txtName.
Using a Database Access97 Please use speaker notes for additional information!
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Adding Code to the Option Button. Open VB 1.Double click the Calculate button and select General from the Object list box. 2.Add the following code to.
Visual Basic 6 Programming Decide how many variables you need by looking at this form. There is one textbox for input and there are 3 labels for output,
Form and Graphical User Interfaces. Lesson plan More about queries More about entering data into a table Form.
Murach’s Visual Basic 2008, C7, modified or added© 2008, Mike Murach & Associates, Inc. Slide 1.
Subroutines (PrArith, Math,projCP1, PrAdrProc, PrAdrProcFunc) Please use speaker notes for additional information!
DEPARTMENT MODULE User’s Guide. Step 1. Click Files Step 2. Click Department.
Problem: Take Two Numbers, Add Them Together And Display The Results. Now To Build The Flowchart… We Probably Need One Like This… Let’s Add The Routines…
Visual Basic Fundamental Concepts
A B C D E F G H U T S R Q P O N I J K L M Z Y X W V 6 Reset scores
Section 64 – Manipulating Data Using Methods – Java Swing
File Handling.
Standard Controls.
Windows Desktop Applications
Please use speaker notes for additional information!
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Visual Basic..
Department Array in Visual Basic
Please use speaker notes for additional information!
Simple Windows Applications
Building an Application in the Visual Basic .NET Environment
Adding Record To Your Database
Chapter 8 - Visual Basic Schneider
Understanding Buttons and TextBoxes
Tutorial 11 Using and Writing Visual Basic for Applications Code
Presentation transcript:

VAT Calculator program Controls Properties Code Results

The control objects are selected and placed on the Form

The Controls on the form

The caption, background colours, font size & colours and other conditions are set in the properties windows for the object

Adding the Code The code window can be accessed by double clicking the object. It takes you to the exact place in the code listing the next sections show the code, the controls and the results in the running application Note the documentary comments in green

Private Sub Form_Load() 'this application is a simple design for a VAT calculator. 'version 1.1 'author T.Vincent WCT 'October lblmessage2.Caption = "Please press the start button" 'initial instructions End Sub

Private Sub cmdStart_Click() txtentdata.Text = "" 'reset the text box lblMessage.Caption = "" 'clear the label message lblmessage2.Caption = "Please type the cost of the product in the box below and then click the Enter button" 'instructions entered in label box txtentdata.SetFocus 'place cursor ready for entering cost of item End Sub

Private Sub cmdEnter_Click() lblMessage.Caption = "You have entered £" & txtentdata.Text 'verification of data entry lblmessage2.Caption = " If this is wrong please press the start button again" ' user validation End Sub

Private Sub cmdVatcalc_Click() Dim sngProdprice As Single 'define data types for data input as single Dim sngVatcost As Single 'define reult of calculation as single On Error GoTo ErrorHandler 'error trap to catch none numeric values Exit Sub ErrorHandler: 'error handling routine for none numeric data lblmessage2.Caption = " You must enter only a number. Please Press Start again" ' error message to return to start Exit Sub

sngProdprice = txtentdata.Text 'change text data from input to string sngVatcost = (sngProdprice / 100) * 17.5 'calculate VAT on entered value sngVatcost = Format(sngVatcost, "currency") 'define output as currency lblMessage.Caption = "The VAT cost is £ " & sngVatcost 'output the result lblmessage2.Caption = "Press the start button again to input new number" 'instruction for new number End Sub

Private Sub cmdQuit_Click() End 'quit the application End Sub