Chapter 2 User Interface Design

Slides:



Advertisements
Similar presentations
Chapter 3 Creating a Business Letter with a Letterhead and Table
Advertisements

Objectives © Paradigm Publishing, Inc. 1 Objectives.
Chapter 3.1 Controls Programming In Visual Basic.NET.
Chapter 2 More Controls Programming In Visual Basic.NET.
© by Pearson Education, Inc. All Rights Reserved. continued …
1.
Introducing More Controls Text boxCheck box Option button Command button frame image.
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.
Chapter 2 More Controls Programming In Visual Basic.NET.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Chapter 2 User Interface Design Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
110-C1 Chapter 2 of the text: _ text boxes, group boxes, check boxes, radio buttons, picture boxes _ defining access keys tab sequence setting the focus.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
Chapter 2 User Interface Design Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
IE 411/511: Visual Programming for Industrial Applications
Chapter 2 More Controls Programming in C#. NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Starting Out with Visual Basic.NET 2 nd Edition Chapter 2 Creating Applications With Visual Basic.NET.
Chapter 2 - More Controls More controls – Text boxes - used for user input – Frames - containers to group items – check boxes - user select an option -
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
User Interface Design. Text Boxes Use a text box control when you want the user to type some input.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
Visual Basic.NET BASICS Lesson 3 Events and Code.
2-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Chapter 2 P. 1 Introducing more controls (on the Toolbox) (Fig. 2.1) - Text box - Frame - Option button - Check box - Image Example P. 44 Figure 2.2 Message.
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.
More Controls and Their Properties Part 4 dbg --- TextBox, CheckBox, RadioButton, GroupBox, ToolTips,
More User Interface Controls User interface controls are located in the toolbox. Click the +/- signs to open/ close the different tabs of the tollbox.
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 User Interface Design.
2-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 User Interface Design.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Microsoft Visual Basic 2005 BASICS Lesson 3 Events and Code.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with Visual Basic.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M. Romi: PPU- IT Dept.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 2 More Controls Programming In C Shap. © Controls in the Toolbox.
Microsoft Visual Basic 2010 CHAPTER FOUR Variables and Arithmetic Operations.
Chapter 4: Do-It-Yourself Designing (Designing Interfaces)
Chapter 1: An Introduction to Visual Basic .NET
Creating a Presentation
Microsoft Visual Basic 2005: Reloaded Second Edition
Microsoft Access 2007 – Level 2
Chapter 1: An Introduction to Visual Basic 2015
IS 350 Course Introduction
Chapter 2 – Introduction to the Visual Studio .NET IDE
Variables and Arithmetic Operations
Program and Graphical User Interface Design
How to design a Windows Forms application
Chapter 3 Fundamentals of Programming in Visual Basic 3
Chapter 2 Visual Basic Interface
Program and Graphical User Interface Design
Variables and Arithmetic Operations
Chapter 2 Adding Web Pages, Links, and Images
Visual Basic.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Visual Basic Objects Controls
DREAMWEAVER MX 2004 Chapter 3 Working with Tables
Visual Studio.
Brief description on how to navigate within this presentation (ppt)
Programming In Visual Basic.NET
Presentation transcript:

Chapter 2 User Interface Design Programming In Visual Basic .NET

Controls in the Toolbox © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Text Box Allows for user input Text Property TextAlign Property What is displayed in text box What user entered in text box TextAlign Property Controls alignment of text in the text box © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 7

Group Box Used as containers for other controls such as radio buttons and check boxes Improves readability of form Text Property What is displayed on the top edge of the group box © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 7

Check Box Allows the user to select or deselect one or more items in any group Checked Property Checked = True Unchecked = False CheckedChanged Event Text Property What is displayed next to the check box © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 10

Radio Button User may select only one in any group First create a group box and then create each radio button inside the group box Checked Property Checked = True Unchecked = False CheckedChanged Event Text Property What is displayed next to the radio button © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 9

Picture Box Displays/contains an image Image Property Complete path and filename of graphic .bmp, .gif, .jpg, .jpeg, .png, .ico, .emf, .wmf SizeMode Property StretchImage causes picture to be resized to match the size of the control Visible Property © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 11

Borders and Styles BorderStyle Property None FixedSingle Fixed3D © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 14

Drawing a Line Use Label Control Text=blank BorderStyle=None BackColor=desired line color Width and Height as desired Use the Graphics Methods covered in Chapter 12 © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Selecting Multiple Controls Shift-Click or Ctrl-Click to select/deselect multiple controls Use the mouse to drag a selection box around multiple controls To deselect all selected controls click elsewhere on the form © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 15

Selecting Multiple Controls (continued) Start here Drag to here Use the mouse to drag a selection box around multiple controls Multiple selected controls, observe selection handles. © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

What Can be Done with Multiple Selected Controls? Move them as a group Set their common properties Use Format Menu or Layout Toolbar to Align them to each other Make same size Modify the spacing between them © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Designing the User Interface To the user the Interface should be Easy to understand Familiar Comfortable Organized Sans Serif Fonts are best, not boldface or large Color Neutral Overall Keyboard Accessible © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Keyboard Access Keys Also referred to as Hot Keys Underlined Letter User presses Alt + underlined letter Use Windows-Standard Keys Defined using Text Property Text=&OK Text=E&xit © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 17

Accept & Cancel Buttons Accept Button Identified visually on Form by its darker outline Responds to Enter key Form's AcceptButton Property Cancel Button Responds to Esc key Form's CancelButton Property © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Focus One control on a Form always has the focus Not all control types can receive the focus TabStop Property (applicable only for controls that are capable of receiving the focus) Designates whether a control is allowed to receive the focus; set to True or False © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Tab Order User should be able to use Tab key to move the focus through a form in an organized manner; top to bottom, left to right TabIndex Property Number in tab sequence 0 for first control to receive the focus when the form loads Use View Menu, Tab Order to set © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 18

Setting TabIndex Property View menu, TabOrder Click on each control in sequence to set TabIndex property of controls automatically © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Form's Screen Location StartPosition Property Manual CenterScreen WindowsDefaultLocation WindowsDefaultBounds CenterParent © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

ToolTips Small label that is displayed when user pauses mouse pointer over a control Steps for creating ToolTips Add a ToolTip Control to Form Appears in the Component Tray, pane at bottom of Form Designer where nondisplay controls are shown Select ToolTip on ToolTip1 Property of each control and add Tool Tip comments © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 19

ToolTip Control Component Tray © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Clearing Text Boxes & Labels Set Text Property equal to an Empty String Empty String is 2 quotation marks with no space between them ("") Use the Clear Method of a Text Box or set Text property to String.Empty nameTextBox.Text = "" messageLabel.Text = "" dataTextBox.Clear( ) messageLabel.Text = String.Empty © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 20

Resetting the Focus Places the Insertion Point in a Text Box Use the Focus Method nameTextBox.Focus( ) © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 21

Setting the Checked Property of Radio Buttons and Check Boxes Selects/Deselects Check Box or Radio Button at design or run time Set Checked Property True = Checked, selected False = Unchecked, deselected redRadioButton.Checked = True displayCheckBox.Checked = False © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 22

Setting Visibility at Run Time Make label invisible messageLabel.Visible = False © 2005 by The McGraw-Hill Companies, Inc. All rights reserved.

Color Constants ForeColor and BackColor Properties Use VB Color Constants from the Color Class View complete list in Help nameTextBox.ForeColor = Color.Red messageLabel.ForeColor = Color.White © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 23

With and End With Change several properties at once in Code Will run more efficiently With titleTextBox .Visible = True .ForeColor = Color.White . Focus( ) End With © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 24

Concatenation Think of it as "tacking" text strings together Use an ampersand (&) preceded and followed by a space between the two strings messageLabel.Text = "Your name is: " & nameTextBox.Text nameAndAddressLabel.Text = nameTextBox.Text & addressTextBox.Text © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 25

Continuing Long Program Lines For long lines of code it is more readable to continue them on the next line At the end of the line use a Line Continuation Character (a Space, an Underscore and press Enter) greetingsLabel.Text = "Greetings " & nameTextBox.Text & ": " & _ "You have been selected to win a free prize." & _ "Just send us $100 for postage and handling." © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. 26