Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of C#
  • Discussion

  • Study Guides

  • Table of Contents

Bookmark and Share

Start Learning Now

Our free lessons will get you started (Adobe Flash® required).
Get immediate access to our entire library.

Sign up for Educator.com

Membership Overview

  • Unlimited access to our entire library of courses.
  • Search and jump to exactly what you want to learn.
  • *Ask questions and get answers from the community and our teachers!
  • Practice questions with step-by-step solutions.
  • Download lesson files for programming and software training practice.
  • Track your course viewing progress.
  • Download lecture slides for taking notes.
  • Learn at your own pace... anytime, anywhere!

Dialog Controls

  • The Dialog Controls allow you to present a standard dialog box to your user without having to code one from scratch
  • The Dialog Controls are:
    • ColorDialog
    • FolderBrowserDialog
    • FontDialog
    • OpenFileDialog
    • SaveFileDialog
  • The OpenFileDialog settings you’ll want to set before using it:
    • .DefaultExt gives the default extension for opening files
    • .Filter allows you to limit the file types that can be selected
    • .FilterIndex will select the default Filter item
    • .FileName will be returned when the user clicks the OK button
  • The SaveFileDialog box uses the same types of parameters as the OpenFileDialog
  • You’ll have to write to code to open or save the file
  • The ColorDialog control has the following settings:
    • .SolidColorOnly =True will only allow the user to select a subset of available colors, =False will show a spectrum the user can choose a color from
      • You’ll want to then get the color from the dialog using .Color.ToKnownColor if you set this to False
    • .Color will allow you to set the initial color selected in the box
  • The FontDialog box has the following settings:
    • .FixedPitchOnly will restrict the list to fixed pitch fonts only
    • .MinSize and .MaxSize will restrict the point size of the fonts available to the user
    • .ShowColor will let the user pick the font color, too