Michael Olivero Microsoft Student Ambassador for FIU Pick up your free drink below to your left. 1 per person please.

Slides:



Advertisements
Similar presentations
110-H1 More VB Tools Creating a Menu: What is a menu? a group of (related) commands displayed at at the top of an application Top level menu Disabled command.
Advertisements

CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 7- 1.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object.
CVEV 118/698 Visual Basic Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
Creating Menu. Objectives Create a menu system for a form –Create a menu –Create a menu titles –Create a menu items –Create a submenu –Modify menu –Edit.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
CST JavaScript Validating Form Data with JavaScript.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 8: String Manipulation
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
Visual Basic Chapter 1 Mr. Wangler.
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.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Microsoft Visual Basic 2005: Reloaded Second Edition
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Multiple Forms, Standard Modules, And Menus
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
CIS—100 Chapter 15—Windows Vista 1. Parts of a Window 2.
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
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
Lập trình trên Windows với Microsoft®.NET Giảng viên : Hồ Hoàn Kiếm.
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.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
1 Working with Menus and Dialog Boxes. 2 Objectives You will be able to Create and edit menus for Windows Forms applications. Write code to handle menu.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 - Graphical User Interface Concepts: Part.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
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.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Engineering\CADD Systems Office CADD Manager's Series Customizing the Interface.
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
HTML FORMS The TEXT Object Presented By: Ankit Gupta.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Compunet Corporation Programming with Visual Basic.NET Working with Menus and Dialog Boxes Week 14 Tariq Aziz and Kevin Jones.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Implement User Input Windows Development Fundamentals LESSON 2.4A.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
GUI Programming Prepared by: Ahmad Ramin Rahimee Assistant Professor ICTI.
Chapter 1: An Introduction to Visual Basic .NET
Chapter 1: An Introduction to Visual Basic 2015
Multi-form applications and dialogs
Lecture Set 11 Creating and Using Classes
Web Development Using ASP .NET
6. WinForms 2003 C# GUI - Basics.
Presentation transcript:

Michael Olivero Microsoft Student Ambassador for FIU Pick up your free drink below to your left. 1 per person please.

Pre-Lecture Topics  Web site resources  Lecture & Materials   MSDN AA program   Clarification / Questions from Previous Lecture  “out” parameter  VB.NET vs. C#  Lab #1?

Topics Covered Today  Basic User Interface Design Principles .NET Forms  Controls & Components  Menus  Validation  Give Away

Basic UI Elements  Forms  Generally contain information or options in order to proceed.  A Form is a class inherited from System.Windows.Forms.Form  Controls  make information and options accessible to users  Some are display only such as labels and picture boxes  Some display and receive input such as text boxes.  Menus  Expose available commands to the users of your application

Things to keep in mind when designing  Simplicity  Grouping Related Controls & Default Values  Common mistake: reproducing real world form  Position of controls  Position of Required vs. Optional  Submit below information  Consistency  Forms should follow a pattern

.NET Forms After this lesson, you will be able to:  State the role of forms in an application  Explain how to add forms to your application  Explain how to set the start-up form and the start-up location  Explain how to set the visual appearance of your form  Explain how to use form events

.NET Forms  Enable interaction between user and application  A way to prompt for or display information without cluttering main UI.  Modal & Non Modal forms.

Common Form Methods  Form.Show()  Loads an instance into memory and makes it visible.  Form.ShowDialog()  Same as Show() except must be closed before control returns to main Form.  Form.Activate()  Brings form to the front and gives it focus.  Flashes task bar if app doesn’t have focus.  Form.Hide()  Hides the form from view. Form still is loaded though.  Form.Close()  Removes form from memory and all related resources.

Events in Forms  Something interesting happens  Think of it as verbs or actions  Form -> Activated  Form -> VisibleChanged  Form -> Move  You can write custom code for any event.

Typical Lifetime Events  Load  Fired when form is loaded into memory  Activate / Deactivate  Fired when form receives focus or looses focus respectively – only among within the current Application.  VisibleChanged  Fired when form is hidden or shown.  Closing  Fired when form is closing  Closed  Fired after form is closed.

Demo  Adding forms to a project  Inheriting existing forms  Setting Start-up Form  Startup location attribute  Appearance Settings  Opacity  Show() vs. ShowDialog()  Handling an Event

Topics Covered Today Basic User Interface Design Principles Basic User Interface Design Principles.NET Forms.NET Forms  Controls & Components  Menus  Validation  Give Away

Controls & Components After this lesson, you will be able to:  Explain the difference between controls and components  Explain how to set the control tab order  Describe which controls can contain other controls and how they are used  Describe docking and anchoring, and explain their use with controls  Describe the process for adding controls to the Toolbox  Describe how to create event handlers for controls  Explain what an extender is and how to use one

Controls & Components Are used to enhance functionality of form.  Component vs. Control?  Control has a Visual Interface  Ex. Button  Component has no Visual Interface  Ex. Timer  Components are added to the Components Tray

Container Controls Allows you to include other controls within them.  Ex. Group Box, Panel, etc.  You can manipulate all the controls together via the container control  Ex. Container.Visible = false

Docking & Anchoring  Specifies behavior of contained controls when form is resized.  Docking  Control is bound to a section of the form: Top, Bottom, Middle, etc.  Anchor  Control is bound by specific distance to edge.

Extender Property Components Components which extend the properties of existing components.  Ex. ToolTip & ErrorProvider  Once added to Form, all controls on form have a new property for definition.

Demo  Component Tray  Tab Order  Docking / Anchoring  Adding Controls to ToolBox  ErrorProvider Extender Control

Topics Covered Today Basic User Interface Design Principles Basic User Interface Design Principles.NET Forms.NET Forms Controls & Components Controls & Components  Menus  Validation  Give Away

Using Menus After this lesson, you will be able to:  Describe the process of creating a menu using the MainMenu component  Describe the process of creating a context menu using the ContextMenu ­component  Explain how to enable or disable a menu item  Explain how to create shortcut keys for menu items  Explain how to display a check mark or a radio button on a menu item  Explain how to make menu items invisible  Explain how to dynamically add items to a menu  Explain how to dynamically clone a menu

Creating Menus in Design  Use the MainMenu from the toolbox  Create new menus  Set the properties of each menu  Assign event handler to each menu  Hints  To create a separator, use the hyphen  Modify other options through the property window while the menu is selected

Creating Menus in Design  Access Key (i.e. ALT-F for File)  Other properties through property window  Checked – displays checkmark next to menu  Radio – displays bullet next to menu

Modifying Menus Dynamically Adding Menu Programatically  MenuItem myItem;  myItem = new MenuItem("Item 1", new EventHandler(ClickHandler));  fileMenuItem.MenuItems.Add(myItem); Merging Menus into One  fileMenuItem.MergeMenu(myContextMenu);

Context Menus  Special menu that appears as a pop-up menu when the right mouse button is clicked.  Can be created similar to a MainMenu using ContextMenu component.  Can be assigned to any Control via ContextMenu property.  Context menu can be cloned from an existing Menu to avoid duplicating code.  myContextMenu.MenuItems.Add(fileMenuItem.CloneMenu());

Things to Know  Menus are like regular controls:  Can make: Visible, Disabled,  You can Merge a menu

Demo  Adding Menu  Adding a Context Menu  Reusing a existing Menu for a Context Menu  Handling an Event for a menu

Topics Covered Today Basic User Interface Design Principles Basic User Interface Design Principles.NET Forms.NET Forms Controls & Components Controls & Components Menus Menus  Validation  Give Away

Validating User Input After this lesson, you will be able to:  Explain the difference between form- level and field-level validation  Direct the focus using control methods and events  Implement form-level validation for your form  Implement field-level validation for your form

Form & Field Level Validation  Form Level  Validates all data at once.  Ex. User fills out entire form and clicks Submit. Validation occurs at the moment of submission.  Field Level  Validates as user enters data

Common Validation Properties  MaxLength  Maximum length textbox can have.  PasswordChar  The character shown to hide actual password characters  ReadOnly  Cannot make changes to control

Common Validation Events  KeyDown, KeyUp, KeyPress Events  Raised when key is pressed.  KeyPress is fired only if key pressed can be represented in by ASCII character.  Ex. ( a-z, A-Z, 0-9, Enter, Backspace )  KeyEventArgs  Parameter passed to Events  Has properties to determine all possible combination of a key event.

Typical Validation Event Handler private void textBox1_KeyUp(object sender, KeyEventArgs e) { if (e.Alt == true)MessageBox.Show("The ALT key is down");}

Character Validation Char data type can be used to inspect character pressed in KeyPress Event  Char.IsDigit  Char.IsLetter  Char.IsLetterOrDigit  Char.IsPunctuation  Char.IsLower  Char.IsUpper

Validating & Validated Events  Validating  Fired before control looses focus.  Validated  Fired after successfully firing Validating  The Validation can be canceled by  e.Cancel = true inside of the handler.

Form Level Validation  All fields are validated at once  Simpler than one may expect  Submit Button Event Handler simply checks controls individually or iteratively.  If one fails the check, then can use ErrorProvider and give it focus.

Topics Covered Today Basic User Interface Design Principles Basic User Interface Design Principles.NET Forms.NET Forms Controls & Components Controls & Components Menus Menus Validation Validation  Give Away