Dialog Boxes and Menus. Menus Menu Bar Contains menus which drop down to display list of menu items Each item has a name and text property Each item has.

Slides:



Advertisements
Similar presentations
* 1 Common Dialog Control. * 2 You want your user to set property or provide your application with some information easily? How do you do it? The Common.
Advertisements

Copyright © 2012 Pearson Education, Inc. Chapter 11 MORE WINDOWS CONTROLS & STANDARD DIALOG BOXES.
Programming In Visual Basic .NET
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.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Dialog Boxes. Slide 2 The OpenFileDialog and SaveFileDialog Controls All dialog boxes derive from the CommonDialog class and share similar features The.
Automating Tasks With Macros
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Using Multiple Forms. Creating a New Form ProjectAdd Windows Form.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
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.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Module 3 Productivity Programs Common Features and Commands Microsoft Office 2007.
Guided Lesson.  In this lesson, you will learn how to modify existing bullets, insert new bulleted and numbered lists, select symbols as bullets, and.
CIS162AD - C# Methods, Menus, and Dialog Boxes 05_methods_menus.ppt.
Several Ways to Print in Windows 98 by Ralph Godinez.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Multiple Forms, Standard Modules, And Menus
MICROSOFT WORD GETTING STARTED WITH WORD. CONTENTS 1.STARTING THE PROGRAMSTARTING THE PROGRAM 2.BASIC TEXT EDITINGBASIC TEXT EDITING 3.SAVING A DOCUMENTSAVING.
5-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
IE 411/511: Visual Programming for Industrial Applications
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
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.
Microsoft Access Lesson 1 Lexington Technology Center February 11, 2003 Bob Herring On the Web at
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.
Productivity Programs Common Features and Commands.
Computing Fundamentals Module Lesson 3 — Changing Settings and Customizing the Desktop Computer Literacy BASICS.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Distributed Multimedia Programming Week - 1. Document Window  The Document Window is divided in to six main components Timeline – The Timeline is where.
XP New Perspectives on Microsoft Windows 2000 Professional Windows 2000 Tutorial 1 1 Microsoft Windows 2000 Professional Tutorial 1 – Exploring the Basics.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
To access our web services, go to……. Click on Customer Login.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
By Felixberto Dominic B. Eruela.  Using a computer to create, edit, and print documents. Of all computer applications, word processing is the most common.
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
Common Dialogs.  What is a Common Dialog/Why use them?  Open Dialog  Save File As Dialog  Color Dialog  Font Dialog  Print Dialog.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10.
Menus Menus provide groups of related commands for windows applications Menu, menu items, submenus A menu item that contains a submenu is considered to.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
 Start Microsoft Word from the icon or shortcut for the application. This is usually accessible from the Start Button. Then go to Programs, then Microsoft.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
> > >> < <
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Access 2002 Advanced Form Design.
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.
Chapter 5 Menus, Sub Procedures and Sub Functions Programming In Visual Basic.NET.
Compunet Corporation Programming with Visual Basic.NET Working with Menus and Dialog Boxes Week 14 Tariq Aziz and Kevin Jones.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
Visual Basic.NET BASICS Lesson 14 Menus and Printing.
Laboratory Exercise # 10 – Microsoft Word Additional Topics Office Productivity Tools 1 Laboratory Exercise # 10 Microsoft Word Additional Topics Objectives:
Building a Simple Text Editor. Create a text editor with the following features: (1) Uses a MenuStrip with File, and Edit tabs (2) The user can create.
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.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Microsoft Office Access 2003
Multi-form applications and dialogs
Microsoft Office Access 2003
Brief description on how to navigate within this presentation (ppt)
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Dialog Boxes and Menus

Menus Menu Bar Contains menus which drop down to display list of menu items Each item has a name and text property Each item has a click event Add MainMenu control to form Appears in the Component Tray, below form, where nondisplay controls are shown Words "Type Here" appear at the top of the form

Type first Menu here MainMenu Control appears in Component Tray

Menu Items To create the menus simply type where the words "Type Here" appear at the top of the form Include & symbol as you type to indicate keyboard access keys You are actually entering the Text property for a MenuItem object Change MenuItem object names in the Properties window and follow consistent naming conventions

The menu items that you create may contain images, access keys, shortcut keys and check marks as well as text labels Image Access Keys Shortcut Keys Check Mark

Submenus Pop up to the right of a menu item Filled triangle to the right of the menu item indicates to the user the existence of a submenu Create submenus by moving to the right of a menu item and typing the next item's text

Context Menus Shortcut menus that pop up when you right-click Are specific to the component to which user is pointing, reflecting options available for that component or situation A context menu does not have a top level menu Application can have multiple context menus

Add ContextMenu component to the form Appears in the Component Tray Click on the words "Context Menu", at the top of the form, the words "Type Here" appear Click on the words "Type Here" and proceed as you did for the main menu

The Built –in Dialog Boxes OpenFileDialog SaveFileDialog FontDialog ColorDialog PrintDialog

© 2005 by The McGraw- Hill Companies, Inc. All rights reserved Component tray Common dialog controls

Displaying a Windows Common Dialog Box Use ShowDialog method to display the common dialog box at run time ShowDialog only displays the dialog, it does not do anything else ColorDialog1.ShowDialog( ) FontDialog1.ShowDialog( )

OpenFileDialog The Open file dialog control prompts the user to open a file and allows the user to select a file to open The user can check if the file exists and then open it It inherits from the abstract class FileDialog

Properties Properties Means AddExtensionGets/Sets if the dialog box adds an extension to file names if the user doesn’t supply the extension. CheckFileExistsGets/Sets if the dialog box displays a warning if the user specifies a nonexistent file. CheckPathExistsGets/Sets whether the dialog box displays a warning if the user gives a path that does not exist. DefaultExtGets/Sets the default file extension. FileNameGets/Sets the file name selected in the file dialog box. FileNamesGets the file names of all selected files. FilterGets/Sets the current file name filter string, which sets the choices that appear in the “Save As File type” or “Files of type” box. InitialDirectoryGets/Sets the initial directory used in the file dialog box.

Methods Method Means OpenFileOpens the file selected by the user, with read only permission. The file is specified by the FileName property. ResetResets all options to their default values. ShowDialogShow the dialog box.

Events Method Means FileOkOccurs when the user clicks the Open or Save Button. HelpRequestOccurs when the user clicks the Help Button.

SaveFileDialog The SaveFileDialog control prompts the user to select a location for saving a file and allows the user to specify the name of the file to save data. The SaveFileDialog control class inherits from the abstract class FileDialog

Properties Properties Means AddExtensionGets/Sets whether the dialog will add an extension to file name if the user does’nt supply the extension. CheckFileExistsGets/Sets if the dialog box displays a warning if the user specifies a nonexistent file. CheckPathExistsGets/Sets whether the dialog box displays a warning if the user gives a path that does not exist. CreatePromptGets/Sets whether the dialog box asks the user if it should create a file if the user specifies a path that does not exists. DefaultExtGets/Sets the default file extension. FileNameGets/Sets the file name selected in the file dialog box. FileNamesGets the file names of all selected files. FilterGets/Sets the current file name filter string, which sets the choices that appear in the “Save As File type” or “Files of type” box. InitialDirectoryGets/Sets the initial directory used in the file dialog box.

Methods Method Means OpenFileOpens the file with read/write permission selected by the user. ResetResets all dialog options to their default values. ShowDialogShow the dialog.

Events Method Means FileOkOccurs when the user clicks the Open or Save Button. HelpRequestOccurs when the user clicks the Help Button.

FontDialog It prompts a user to choose a font from among those installed on the local computer and lets the user select the font, font size and color. It returns the font and color objects By default the Color ComboBox is not shown on the Font Dialog box. You should set the ShowColor property of the FontDialog control to be true.

Properties Properties Means AllowSimulationsGets/Sets whether the dialog box allows graphics device interface font simulations. ColorGets/Sets the selected font color. FontGets/Sets the selected font. MaxSizeGets/Sets the maximum point size a user can select. MinSizeGets/Sets the minimum point size a user can select. ShowColorGets/Sets whether the dialog box displays the color choice. ShowApplyGets/Sets whether the dialog box contains an apply button. ShowEffectsGets/Sets whether the dialog box contains controls that allow the user to specify strikethrough, underline and text color options.

Methods Method Means ResetResets all dialog options to their default values. ShowDialogShow the dialog.

Events Method Means ApplyOccurs when the user clicks the Apply Button. HelpRequestOccurs when the user clicks the Help Button.

ColorDialog The color dialog control class represents a common dialog box that displays available colors along with controls that enable a user to define custom colors. It lets a user select a color The main property of the ColorDialog control is Color, which returns a color object

Properties Properties Means AllowFullOpenGets/Sets whether the user can use the dialog box to define custom colors. AnyColorGets/Sets whether the dialog box displays all available colors in the set of basic colors. ColorGets/Sets the color selected by the user. CustomColorsGets/Sets the set of custom colors shown in the dialog box. ShowHelpGets/Sets whether the help button appears in the color dialog box.

Methods Method Means ResetResets all dialog options to their default values. ShowDialogShow the dialog.

Events Method Means HelpRequestOccurs when the user clicks the Help Button

PrintDialog It lets the user to print documents by selecting a printer and choosing which sections of the document to print from a Windows Form Application. There are various other controls related to printing of documents. PrintDocument PrinterSettings PageSetUpDialog PrintPreviewControl PrintPreviewDialog

Properties Properties Means AllowPrintToFileGets/Sets whether the print to file checkbox is enabled. AllowSelectionGets/Sets whether the selection radio button is enabled. AllowSomePagesGets/Sets whether the From..To.. Page radio button is enabled. DocumentGets/Sets the PrintDocument used to obtain PrinterSettings. PrinterSettingsGets/Sets the PrinterSettings Dialog box to modify. PrintToFileGets/Sets whether the print to file checkbox is enabled. ShowHelpGets/Sets whether the help button is displayed.

Methods Method Means ResetResets all dialog options to their default values. ShowDialogShow the dialog.

Events Method Means HelpRequestOccurs when the user clicks the Help Button