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.

Slides:



Advertisements
Similar presentations
Information System Design Lab 5&6. User Interface Design.
Advertisements

Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Using Macros and Visual Basic for Applications (VBA) with Excel
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.
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.
Click your mouse to continue Menu Conventions A check mark option is a toggle or “on-off” switch (like a light switch) that is either checked (turned on)
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,
Integrating Access with the Web and with Other Programs.
Automating Tasks With Macros
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
CVEV 118/698 Visual Basic Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
MENUS AND THE MENU EDITOR Elements of a Menu Menu bar Menu title Separator bar Menu items.
Using the Visual Basic Editor Visual Basic for Applications 1.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Creating, Formatting, and Editing a Word Document with a Picture
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.
Chapter 5 Using Business Information Sets
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)
Printing and Page Formatting ITSW 1401, Intro to Word Processing Instructor: Glenda H. Easter.
Module 3 Productivity Programs Common Features and Commands Microsoft Office 2007.
PYP002 Intro.to Computer Science Microsoft Word1 Lab 07 Creating Documents with Efficiency and Consistency.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 8: String Manipulation
Visual Basic Chapter 1 Mr. Wangler.
Microsoft Word 2010 Chapter 1 Creating, Formatting, and Editing a Word Document with Pictures.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
The Common Dialog Box. Installing the Common Dialog Box May NOT be your standard VB toolbox.
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.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Productivity Programs Common Features and Commands.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
ListBox, ComboBox, Menu Chapter 5.4, ComboBox Control: Properties & Methods u Combines TextBox features with a short drop- down list  cboOne.AddItem(string)
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
OCC Network Drives  H:\  P:\ 
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Click your mouse to continue. Creating a New Mail Merge Document When you need to create a form letter but do not have an existing main document, you can.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
Visual Basic CDA College Limassol Campus Lecture:Pelekanou Olga Semester C Week - 1.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
1 After completing this lesson, you will be able to: Get around the Internet with your browser. Connect to the Internet. Print Web pages. Save Web pages.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
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.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
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 8 1 Microsoft Office Access 2003 Tutorial 8 – Integrating Access with the.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
Visual Basic.NET BASICS Lesson 14 Menus and Printing.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
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.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Multiple Forms and Menus
Excel Tutorial 8 Developing an Excel Application
Microsoft Office Access 2003
Microsoft Office Access 2003
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

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 the Menu Editor in any of three ways: –click the Menu Editor button on the toolbar; –choose Tools, Menu Editor; –or press Ctrl+E. The Menu Editor then appears, as:

Slide 3 Menu Controls v Each line of text (menu item) in a menu is a Menu control with the following properties: –Caption: The caption is the actual text that is displayed in the menu item. –Name: This property is used to identify the menu item in code. –Index: If this menu item is part of control array, –Shortcut: With this property, you can define shortcut key combinations that allow your users to select a menu item with one keystroke, –Checked: If this property is True, a check mark appears to the left of the menu item’s caption to indicate, –Enabled: This property can be set to False if its associated action isn’t appropriate at a particular time. –Visible. This property determines whether the menu item can be seen.

Slide 4 Multiple-Level Menus v Menus in Windows-based applications contain multiple levels of commands. v Top-level menu items are the ones that are visible in the program’s menu bar. v Clicking a toplevel menu item opens that item’s submenu. v You can then insert separator bars to group the related functions.

Slide 5 Writing Code for the Menu Items v A menu item handles only one event: the Click event. v This event is triggered when a user clicks the menu item, or when the user selects the item and presses Enter. v To add code to a menu item’s Click event procedure, first select the menu item on the form by clicking the item, then write the event procedure.

Slide 6 Other Properties v The Visible and Enabled Properties: –mnuFileSave.Enabled = True –mnuFileSendTo.Enabled = True –mnuFilePrint.Enabled = True –mnuEdit.Visible = True v The Checked Property –mnuOptionsText.Checked = True –mnuOptionsText.Checked = Not mnuOptionsText.Checked

Slide 7 CommonDialog Control v Using a single CommonDialog control, you have access to the following standard Windows dialog boxes: –Open. Lets the user select the name and location of a file to open. –Save As. Lets the user specify a filename and location in which to save information. –Font. Lets the user choose a base font and set any font attributes that are desired. –Color. Lets the user choose from a standard color or create a custom color for use in the program. –Print. Lets the user select a printer and set some of the printer parameters. –Help. Takes the user into the Windows Help system.

Slide 8 CommonDialog Control v To access the CommonDialog control, you might first have to add it to your project (and to the Toolbox) by selecting it from the Components dialog box. v You can access this dialog box by choosing Project, Components. From there, select Microsoft Common Dialog Control 6.0 in the Controls list and click OK.

Slide 9 The File Dialog Boxes v File dialog box can be used in either of two modes: Open and Save As. v Opening Files: –cdlTest.ShowOpen –Msgbox “You Selected “ & cdlTest.FileName & “ to be opened.” v Saving Files: –cdlTest.ShowSave –Msgbox “You Selected “ & cdlTest.FileName & “ to be saved.” v Specifying File Types with the Filter Property: –cldTest.Filter = “Word Documents (*.doc)|*.doc” –cdlTest.Filter = “Text Files (*.txt)|*.txt|All Files (*.*)|*.*” –cdlTest.ShowOpen

Slide 10 The Font Dialog Box v Flags property v If you do not set a value for the Flags property, you get an error message stating that no fonts are installed. v Example: –cdlTest.Flags = cdlCFBoth + cdlCFEffects –cdlTest.ShowFont –lblTest.Font.Name = cdlTest.FontName –lblTest.Font.Size = cdlTest.FontSize –lblTest.Font.Bold = cdlTest.FontBold

Slide 11 The Font Dialog Box v Setting a text box font –Set txtAddress.Font = txtName.Font

Slide 12 The Color Dialog Box v You set the Flags property to the constant cdlCCRGBInit and then invoke the control’s ShowColor method. –cdlTest.Flags = cdlCCRGBInit –cdlTest.ShowColor –Form1.BackColor = cdlTest.Color