Chapter 2 User Interface Design Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.

Slides:



Advertisements
Similar presentations
Prof. Yitzchak Rosenthal
Advertisements

Chapter 3 Creating a Business Letter with a Letterhead and Table
Using Macros and Visual Basic for Applications (VBA) with Excel
Chapter 3.1 Controls Programming In Visual Basic.NET.
Chapter 2 More Controls Programming In Visual Basic.NET.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls.
© by Pearson Education, Inc. All Rights Reserved. continued …
1.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
Introducing More Controls Text boxCheck box Option button Command button frame image.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Chapter 2 More Controls Programming In Visual Basic.NET.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
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.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 1: Chapter 2: Slide 1 Unit 1 Introduction to Programming Using VB.NET Chapter.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
Microsoft Word 2010 Chapter 1 Creating, Formatting, and Editing a Word Document with Pictures.
Lab 9 – User Forms Design. User Forms What are user forms? –Known as dialog boxes –Major ways for getting user input An example of using user forms: Monthly.
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 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Chapter 2 More Controls Programming in C#. NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Microsoft Word 2000 Presentation 5. Major Word Topics Columns Tables Lists.
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 -
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 14 Tables.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 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.
XP Practical OpenOffice.org Chapter 8 1 Creating a Presentation.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
Visual Basic.NET BASICS Lesson 3 Events and Code.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
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 2005 BASICS Lesson 3 Events and Code.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
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.
Graphical User Interface Concepts - Part 1 Session 08 Mata kuliah: M0874 – Programming II Tahun: 2010.
Chapter 1: An Introduction to Visual Basic .NET
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 1: An Introduction to Visual Basic 2015
How to design a Windows Forms application
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Visual Studio.
Brief description on how to navigate within this presentation (ppt)
Programming In Visual Basic.NET
Chapter 2 User Interface Design
Presentation transcript:

Chapter 2 User Interface Design Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill

2-2 Objectives (1 of 2) Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively. Set the BorderStyle property to make controls appear flat or three-dimensional. Select multiple controls and move them, align them, and set common properties. Make your projects easy for the user to understand and operate by defining access keys, setting an accept and a cancel button, controlling the tab sequence, resetting the focus during program execution, and causing ToolTips to appear.

2-3 Objectives (2 of 2) Clear the contents of text boxes and labels. Change text color during program execution. Code multiple statements for one control using the With and End With statements. Concatenate (join) strings of text. Make a control visible or invisible at run time by setting its Visible property.

2-4 More Controls

2-5 Text Box Allows for user input Text property What is displayed in text box What user entered in text box TextAlign property or HorizontalAlignment.Left Controls alignment of text in the text box

2-6 Masked Text Box

2-7 Group Box Used as a container for other controls such as radio buttons and check boxes Improves readability of form by separating the controls into logical groups Example Names for Group Boxes ColorGroupBox StyleGroupBox

2-8 Check Box Allows the user to select or deselect one or more items in any group Checked property Checked = True Unchecked = False Use the Text property for the text you want to appear next to the box. Example names for Check Boxes BoldCheckBox ItalicCheckBox

2-9 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 Selected = True Unselected = False Text property What is displayed next to the radio button Example Names for Radio Buttons RedRadioButton BlueRadioButton

2-10 Picture Box Displays/contains an image Image property Complete path and filename of graphic; it’s a good idea to place the graphic into the folder with your project before it is assigned to a picture box. Can set extension to.bmp,.gif,.jpg,.jpeg,.png,.ico,.emf,.wmf PictureBox controls have several useful properties such as the SizeMode property. StretchImage causes picture to be resized to match the size of the control, or the Visible property, which can be set to False to make the picture disappear

2-11 Borders and Styles Most controls can appear to be three-dimensional or flat. Labels, text boxes, and pictures boxes all have a BorderStyle property with different style choices including: None FixedSingle Fixed3D properties that can be changed to the style of choosing

2-12 Drawing a Line A line can be drawn on a form by using the Label control. Lines can be used in logos or to divide the screen. To create the look of a line, set the following properties: Text=blank BorderStyle=None BackColor=desired line color Width and Height, located beneath the Size property as desired A line can also be drawn on a form using the graphics methods that are discussed in Chapter 13.

2-13 Selecting Multiple Controls (1 of 2) There are several methods of selecting multiple controls, which means controls can be moved as a group. Shift-Click or Ctrl-Click to select/deselect multiple controls. Use the mouse to drag a selection box around multiple controls. When wanting to select most of the controls on the form, use a combination of the two methods. To deselect all selected controls, click elsewhere on the form.

2-14 Selecting Multiple Controls (2 of 2) Use the mouse to drag a selection box around multiple controls. When multiple controls are selected, each has resizing handles (if resizable).

2-15 Working With Multiple Controls What are some of the benefits of working with Multiple Controls? Drag a group of selected controls to move the entire group to a new location at one time. Set common properties. Use Format Menu or Layout Toolbar to Align controls to each other. Make controls the same size. Modify the spacing between controls.

2-16 Designing the User Interface The design of the screen should be easy to understand and “comfortable” for the user. The best way to accomplish these goals is to follow industry standards for the color, size, and placement of controls. To the user, the Interface should be Familiar Comfortable Organized—group controls Sans Serif Fonts are best, not boldface or large Gray is a neutral color that works well Keyboard Accessible

2-17 Keyboard Access Keys Many people prefer to use the keyboard, rather than a mouse, for most operations. 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

2-18 Accept & Cancel Buttons Accept Button Identified visually on Form by its darker outline Responds to Enter key Form's AcceptButton property Cancel Button Form's CancelButton property An example of a Cancel button is the Esc key.

2-19 Setting the Tab Order of Controls (1 of 2) One control on a Form always has the focus. Not all control types can receive the focus. Text boxes, buttons — focus Picture boxes and labels — no focus TabStop property is 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 TabIndex property determines the order the focus moves as the Tab key is pressed.

2-20 Setting the Tab Order of Controls (2 of 2)

2-21 Setting the TabIndex Property

2-22 Setting the Form’s Screen Location

2-23 Creating ToolTips Small label that is displayed when user pauses mouse pointer over a control Add a ToolTip Control to Form. The new control appears in a new pane, Component Tray, which opens at the bottom of the Form Designer. After you add the component to your form, each of the form’s controls has a new property. Select ToolTip on ToolTip1 property of each control and add Tool Tip comments.

2-24 ToolTip Control

2-25 Clearing Text Boxes and Labels

2-26 Resetting the Focus Places the Insertion Point in a Text Box Use the Focus Method. Statement to set the insertion point in the text box called NameTextBox is as follows: NameTextBox.Focus = ( )

2-27 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 In code, assign True to its Checked property. RedRadioButton.Checked= True DisplayCheckBox.checked=False

2-28 Setting Visibility at Run Time Make label invisible. Make label visible. MessageLabel.Visible= False MessageLabel.Visible= True

2-29 Changing the Color of Text Change ForeColor and BackColor Properties. Use VB Color Constants from the Color Class. Type the keyword Color and a period in the editor to view a full color list. Color.AliceBlue Color.AntiqueWhite Color.Blue NameTextBox.ForeColor= Color.Red MessageLabel.ForeColor=Color.White

2-30 Changing Multiple Properties of a Control There are times when you will want to change several properties of a single control. Previous to version 4, the entire name (Object.Property) for each statement had to be written, such as: TitleTextBox.Visible = True TitleTextBox.ForeColor = Color.White TitleTextBox.Focus() Now, VB provides With and End With statements.

2-31 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

2-32 Concatenation Think of concatenation as "tacking" text strings together. Use an ampersand (&) preceded and followed by a space between the two strings. Example: MessageLabel.Text="Your name is: " & NameTextBox.Text NameAndAddressLabel.Text=NameTextBox.Text & " " AddressTextBox.Text

2-33 Continuing Long Program Lines (1 of 2) 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. "

2-34 Continuing Long Program Lines (2 of 2) Visual Basic 2010 offers the option of implicit line continuation (i.e. no explicit line continuation characters) This innovation is overdue, and welcomed by professional developers. GreetingsLabel.Text="Greetings " & NameTextBox.Text & ":" & "You have been selected to win a free prize. " & "Just send us &100 for postage and handling. "