Neal Stublen Tonight’s Agenda  More form controls  Multi-form projects  Application debugging  Object-oriented programming and.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Select Case Statements and Selection Input.
Advertisements

Information System Design Lab 5&6. User Interface Design.
Programming with Microsoft Visual Basic th Edition
Microsoft Visual Basic: Reloaded Chapter Five More on the Selection Structure.
Creating Custom Reports. 2 Design and create a custom report You can easily create custom reports based on a table or query. There are seven sections.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Exploring Office Grauer and Barber 1 Creating More Powerful Applications: Introduction to VBA(Wk9)
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
DT265-2 Object Oriented Software Development 2 Lecture 3 : Windows Programming Lecturer Pat Browne
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Programming with Microsoft Visual Basic th Edition CHAPTER SEVEN SUB AND FUNCTION PROCEDURES.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
JavaScript Form Validation
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 6 Understanding the Structure of an Application: Procedures, Modules, and Classes.
CIS 200 Final Review. New Material Data Structures.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
CIS 200 Test 02 Review. Windows Forms, GUI Programming  Elements  Textboxes  Tab Groups  Checkboxes  Fields  Event Handlers  Visual Studio Designer.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Multi-Part Requests/ Parent & Child Service Items.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
1 OPOL Training (OrderPro Online) Prepared by Christina Van Metre Independent Educational Consultant CTO, Business Development Team © Training Version.
5-1 Chapter 5 The Repetition Process in VB.NET. 5-2 Learning Objectives Understand the importance of the repetition process in programming. Describe the.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Five More on the Selection Structure.
Controls in C++/CLI (2) CheckBox RadioButton GroupBox ListBox.
Working with option button, check box, and list box controls Visual Basic for Applications 13.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
Decisions and Debugging Part06dbg --- if/else, switch, validating data, and enhanced MessageBoxes.
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic 2005, Third Edition.
1 Chapter Nine Using GUI Objects and the Visual Studio IDE.
FIX Eye FIX Eye Getting started: The guide EPAM Systems B2BITS.
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
1 Chapter Ten Using Controls. 2 Objectives Learn about Controls How to create a Form containing Labels How to set a Label’s Font How to add Color to a.
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.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
1.
You can sort Access data so you can view records in the order you want to view them, and you can filter data so you only see the records you want to see.
Microsoft Visual Basic 2012 CHAPTER ELEVEN Multiple Classes and Inheritance.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Controls Part 2. DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically.
Customizing Reports Adding a Date to a Report Reference Window Adding a Date to a Report Display the report in the design view Click the Text Box Tool.
Unit 6 Repetition Processing Instructor: Brent Presley.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Chapter 27. Copyright 2003, Paradigm Publishing Inc. CHAPTER 27 BACKNEXTEND 27-2 LINKS TO OBJECTIVES Track and Customize Changes Track and Customize Changes.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Input Boxes, List Boxes, and Loops Chapter 5. 2 Input Boxes Method for getting user’s attention to obtain input. InputBox() for obtaining input MessageBox()
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic Fundamental Concepts
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Using GUI Objects and the Visual Studio IDE
Microsoft Office Access 2003
Visual Basic..
Multi-form applications and dialogs
Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline Test-Driving the Security Panel Application.
Lecture Set 10 Windows Controls and Forms
Based on Murach Chapter 10
Presentation transcript:

Neal Stublen

Tonight’s Agenda  More form controls  Multi-form projects  Application debugging  Object-oriented programming and classes  Q&A

Practice Exercise  Write a program that can record ten student grades What will you use to store the grades?  Find the average of those grades, but don’t include the lowest grade in the average How will you determine the lowest grade? How will you remove it from the average?

Radio Button  Grouped with other RadioButtons for mutually exclusive selection Property: Checked Event: CheckedChanged  Use a GroupBox to indicate which buttons are related

Checkbox  Turns a selection on or off Property: Checked Event: CheckedChanged  Can be indeterminate Property: CheckedState Event: CheckedStateChanged

ComboBox  Select one item from a group of items Property: SelectedIndex Event: SelectedIndexChanged  DropDownStyle Simple DropDown DropDownList

ListBox  Select one or more items from a list of items Property: SelectedIndex, SelectedIndices, SelectionMode Event: SelectedIndexChanged  Shift and Ctrl keys allow multiple selection

Group Box  Radio buttons can be grouped together  Controls in a group box move together  Grouping controls impacts tab order

View Help  Select any control on a form, press F1  Overview of controls  Key properties and methods

Which control to use?  Your application prints reports. Which control would you use to: Select one of many report template Show or hide page headers Select from no headers, brief headers, or verbose headers Select a printer when printing the report

Working with Forms  Additional forms can be added to a project  Load event typically initializes a form  Typically the form’s name matches the file where it is defined Renaming the form’s file will rename the form  An application’s initial form is determined in the Main function of the Program class Also set in project properties

Modal vs. Modeless  “Modeless” windows do not restrict access to other windows/forms An application’s main window/form is typically modeless  “Modal” windows restrict access to other windows/forms Commonly referred to as “dialog boxes” Access to a “parent” form is blocked File | Open...

Modal Forms  Modal forms typically have a certain visual appearance FormBorderStyle ControlBox, MaximizeBox, MinimizeBox  Modal forms are displayed with a different method Show() vs. ShowDialog()  Modal forms communicate information to a parent form Form.Tag and Form.DialogResult Button.DialogResult

Simple Messages  MessageBox is a special modal form MessageBoxButtons MessageBoxIcon MessageBoxDefaultButton DialogResult  Used for alerting the user or requesting simple feedback MessageBox.Show(...);

Closing a Form  What happens when we close a form? FormClosing event  What can we do when a form closes? Prompt before closing a form Prevent the form from closing ○ FormClosingEventArgs.Cancel

A Simple Example  First form contains a Label for a name and an “Edit...” Button  Second form contains a TextBox with a name and OK and Cancel Buttons  The name should be passed into and out of the second form  The name should update on the first form when OK is clicked on the second form  The second form should confirm before exiting, but only if the name was changed

Debugging Windows  Debug > Windows > Locals Variables scoped to the current method  Debug > Windows > Autos Variables from current and previous statements  Debug > Windows > Watch  View and edit any value in the debugger  Debug > Windows > Immediate Evaluate expressions, call methods

Call Heirarchy  View > Call Heirarchy View all calls to and from any method

Output Window  Debug > Windows > Output Console.WriteLine();

Edit and Continue  Some changes can be made while debugging  Visual Studio will incorporate the changes as you debug the application

Debugging Options  Tools > Options Debugging  Debug > Exceptions When thrown When unhandled

Debug and Release Builds  Debug versions of an application contain additional information for tracking down problems  An assembly is built as either a debug or release version

Debug and Trace Info  System.Diagnostics.Trace Release and debug builds  System.Diagnostics.Debug Only debug builds  Logging execution information WriteLine AutoFlush, IndentSize, etc.  Confirming assumptions Assert

Additional Help  MSDN Tracing and Instrumenting Applications us/library/zs6s4h68(v=vs.110).aspx us/library/zs6s4h68(v=vs.110).aspx

Classes  Fields (data members)  Constructors (initialization)  Methods  Properties  Practice the principle of encapsulation Implementation of an object is encapsulated within the class How does a Gradebook object calculate averages? ○ It shouldn’t matter

Tiered Architecture  Presentation layer Forms  Middle layer (business logic) Business rules, calculations, special logic ○ Should a customer receive special rewards? ○ What is the local sales tax in Overland Park?  Database layer Access to physical storage ○ MySQL, Oracle?

Namespaces  Partition classes to group functionality  Specify classes using fully qualified name, or use the namespace within a.cs file

StudentGradeBook Class  Create a StudentGradeBook class  The grade book should store up to ten homework grades and four test grades  Add a methods to insert test and homework grades  Add a method to clear all grades  Add a property to return a final average (based on 80% tests and 20% homework)

StatsCalculator Example  Create a StatsCalculator class  Create a method for adding numeric values to the StatsCalculator  Create properties that will return: Total number of values Sum of values Average of values Minimum and maximum values  Create a method that will clear the calculator

Class Summary  Fields can be readonly  Control access with public/private  Initialize through constructor or object initializers  Properties have get and set blocks Read/write, read-only, write-only Auto-implemented  Methods can be overloaded  Members can be static

Member Variable Defaults  Numeric types = 0  Boolean = false  Char = 0  Object = null  Date = 12:00am

Class vs. Struct  Difference between reference and value types  Class requires “new”, struct does not

Suggested Practice  Exercise 12-1, p. 391

Start thinking about what classes might be used to model objects in the type of applications you will be writing. Are there any questions about objects you might be trying to model?