Common Dialogs.  What is a Common Dialog/Why use them?  Open Dialog  Save File As Dialog  Color Dialog  Font Dialog  Print Dialog.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

* 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.
Chapter 1: An Introduction to Visual Basic 2012
Copyright © 2012 Pearson Education, Inc. Chapter 11 MORE WINDOWS CONTROLS & STANDARD DIALOG BOXES.
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.
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.
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
Dialog Boxes. Slide 2 The OpenFileDialog and SaveFileDialog Controls All dialog boxes derive from the CommonDialog class and share similar features The.
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.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Web Feature Creating Web Pages Using Word.
FIRST COURSE Creating Web Pages with Microsoft Office 2007.
Printing and Page Formatting ITSW 1401, Intro to Word Processing Instructor: Glenda H. Easter.
Document Basics Lesson 2. Skills Matrix SKILL #MATRIX SKILL 1.1.2Apply Quick Styles to documents 1.1.3Format documents using themes 1.1.4Customize a theme.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
1 Windows Printing. 2 Objectives You will be able to Output text and graphics to a printer. Print multipage documents. Use the standard Windows print.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
XP Chapter 4 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Collecting Data for Well-Designed Forms Chapter 4 “Making.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
5-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
Font change in Word Font change in Excel 1. Click on Font Face and choose Tsuig_04 2. Click on Font Size and choose 28 pt 3. Press Shift+Alt to turn on.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
Adobe InDesign CS5 – Illustrated Unit E: Using Master Pages Adobe InDesign CS5 – Illustrated Unit E: Using Master Pages.
Chapter 2 - More Controls More controls – Text boxes - used for user input – Frames - containers to group items – check boxes - user select an option -
Enhancing the Graphical User Interface Multiple Forms, Controls, and Menus.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Lesson 12: Creating a Manual and Using Mail Merge.
Lecture Set 12 Sequential Files and Structures Part A – Dialog Boxes, Filters, Directories.
VistA Imaging Workstation Configuration. October The information in this documentation includes functionality of the software after the installation.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Visual Basic CDA College Limassol Campus Lecture:Pelekanou Olga Semester C Week - 1.
The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10.
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.
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.
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.
Simple Clicker App WPF App using C#. App Requirement Need a ‘counter’ display, which starts at 0 Need a ‘clicker’ button ! Pressing the clicker every.
Chapter 5 Menus, Sub Procedures and Sub Functions Programming In Visual Basic.NET.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Prepared by the Academic Faculty Members of IT. Tables Creating Tables. Merging Cells. Splitting Cells. Sorting Tables. Performing Calculations.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
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.
Lessons Copy and Paste Text Drag and Drop Text 2-Saving Documents 3- Printing 4-Inserting Tables Modifying Page Layout Format Page Margins Insert a Blank.
2-1 Chapter 2 Using VB.NET to Create a First Solution.
Dialog Boxes Getting information from user. Types of Windows Five types we’ll be using 1. Main Application Window 2. Child Windows 3. Dialog Boxes 4.
Dive Into® Visual Basic 2010 Express
Visual Basic .NET BASICS
Microsoft Visual Basic 2005 BASICS
GUI Programming using Windows Form
File Handling.
Using Multiple Forms.
Microsoft Office Access 2003
Microsoft Office Access 2003
Menus and Dialogs.
Common Dialog Boxes.
Chapter 4 Enhancing the Graphical User Interface
Tutorial 11 Using and Writing Visual Basic for Applications Code
Presentation transcript:

Common Dialogs

 What is a Common Dialog/Why use them?  Open Dialog  Save File As Dialog  Color Dialog  Font Dialog  Print Dialog

 A “Common” dialog is one that you will use often, and are familiar with  Save programmers work  Help users with consistent interface  Common dialogs are provided by Windows  Look/feel the same way for every application  Common properties  Easy to modify  Many available methods  Can override default behavior

 Used when you need to open a file  Drag/drop Open File control from the toolbox  Does not show on form, but in control tray  Display by calling on ShowDialog method: If ofdOpenFile.ShowDialog() = Windows.Forms.DialogResult.OK Then MessageBox(“The file is: “ & ofdOpenFile.FileName) Else MessageBox(“No file was selected.”) End If

 Function returns a predefined constant, based on the button pressed:  Abort  Cancel  Ingnore  No  None  OK  Retry  Yes

 Other properties on the control:  Filter property. You can set the initial filter.  Filter is a string with two parts  The text to show for the filter type  The file type  You can have multiple filters  Separate the filters with a pipe (“|”)  Example: ofdOpenFile.Filter = “Text files (*.txt)|*.txt|All files (*.*)|*.*”

 You can set the initial directory that is displayed with the InitialDirectory property ofd.OpenFile.InitialDirectory = “c:\users\marty\stonehill”  You can set the title of the Open Dialog with the Title property

 Used to save a file to a file name  Drag a Save File Dialog to the form  The InitialDirectory, Title, Filter properties are EXACTLY the same as the are for the Open Dialog  When you have the name of the file to save, you can open the file with normal file operations

 You can choose colors for your program at run time with the ColorDialog control  It is dragged to the form, modified, and opened exactly the same as the other common dialogs  You can set the initial color by setting the.Color property  If the user presses OK, the dialog returns the color selected in the.Color property cdColor.Color = Color.Blue If cdColor.ShowDialog() = Windows.Forms.DialogResult.OK Then MsgBox(“Color selected is: “ & cdColor.Color End If

 Same process as all other common controls  The results are returned in the.Font property  You can set the initial value with the.Font property  Then use that selected font by setting it for another control If fdFont.ShowDialog() = Windows.Forms.DialogResult.OK Then txtSomeTextBox.Font = fdFont.Font

 You can drag the Print Document Control to your form  Print by calling on the.Print method for the common control  This common dialog is a bit more complicated  When you tell the program to print, it calls on a PrintPage event to print the page  You must write the code in the print page event so that the page gets printed  See section 9.3 for more details