SlideShare a Scribd company logo
Session 5
Slide 1 of 1309/20/13
Dialog Boxes
Slide 2 of 2609/20/13
Module Introduction
+ A dialog box is a special window, which can be used to interact with the user and display
information.
+ It acts as a container that can hold various controls to retrieve information.
+ Dialog boxes are divided into two categories :
- Common dialog boxes are system-defined dialog boxes
- Custom dialog boxes are user-defined dialog boxes.
Slide 3 of 2609/20/13
A dialog box is a window that allows you to collect and display related information using
various controls.
Some of the dialog boxes that you have used in Windows are Save As, Color, Print and
Page Setup.
Introduction to Dialog Boxes
Slide 4 of 2609/20/13
Elements
A dialog box consists of:
• Title bar displaying caption and the close icon
• Instruction text informing what the user should do (optional)
• Content with controls to select or display information
• Action area having buttons and link labels
• Footnote area explaining about the window (optional)
Slide 5 of 2609/20/13
Features
A dialog box is different from forms because of some basic features. These
are:
+ Non-resizable: A dialog box is not resizable and cannot be maximized or
minimized.
+ Usually Modal: A dialog box is usually of modal type. This means that the
user is not allowed to focus on any other window until the dialog box is
closed.
+ Common Set of Buttons and Icons: a dialog box consists of some standard
buttons such as OK and Cancel.It also consists of the Help and Close icons on
its top-right corner.
Slide 6 of 2609/20/13
Modal Dialog Box
There are two types of dialog boxes namely : modal and modeless.
+ A modal dialog box does not allow the user to activate any other window in the application
unless the dialog box is closed.
+ A modeless dialog box allows user to focus and work with the same application without
closing the dialog box.
Slide 7 of 2609/20/13
Common and Custom Dialog Boxes
+ Common dialog boxes are system-defined dialog boxes such as Open, Save and Print.
These dialog boxes are reusable and hence can be used across various applications.
+ Custom dialog boxes are user-defined dialog boxes. These dialog boxes are useful
when the system-defined dialog boxes do not fulfill certain requirements.
Slide 8 of 2609/20/13
"CommonDialog" Class
The CommonDialog class is the base class for all common dialog boxes. This class exists
in the System.Windows.Forms namespace.
Slide 9 of 2609/20/13
"ColorDialog" Component
The ColorDialog component is a dialog box that allows you to select system-defined colors
from the color palette.
Slide 10 of 2609/20/13
"ColorDialog" Class
Slide 11 of 2609/20/13
"FontDialog" Component
The FontDialog component allows you to select different fonts that are installed in the
system.
Slide 12 of 2609/20/13
"FontDialog" Class
Slide 13 of 2609/20/13
"OpenFileDialog" and "SaveFileDialog" Components
The OpenFileDialog and SaveFileDialog are the most commonly used dialog boxes in
applications. The OpenFileDialog component allows you to open a file and the SaveFileDialog
component allows you to save a file.
Slide 14 of 26
09/20/13
"OpenFileDialog" Class
Slide 15 of 2609/20/13
"SaveFileDialog" Class
Slide 16 of 2609/20/13
"PageSetupDialog" Component
The PageSetupDialog component is a system-defined dialog box, which allows the user to
set the page layout for printing. It provides various options such as the border and margin
adjustments, headers and footers, and portrait and landscape orientation for the page to be
printed.
Slide 17 of 2609/20/13
"PageSetupDialog" Class
Slide 18 of 2609/20/13
"PrintDialog" Component
The PrintDialog component is a system-defined dialog box that allows you to print the
documents.
Slide 19 of 2609/20/13
"PrintDialog" Class
Slide 20 of 2609/20/13
"PrintPreviewDialog" Control
The PrintPreviewDialog control is used to display the way a document will appear when
printed.
Slide 21 of 2609/20/13
"PrintPreviewDialog" Class
Slide 22 of 2609/20/13
User-Defined Dialog Boxes
A system-defined dialog box does not always fulfill the requirements of the developers and
users. In such cases, a developer needs to create custom dialog boxes to fulfill the
requirements. To do so, you can convert a form into a user-defined dialog box.
To create a user-defined dialog box:
+ The FormBorderStyle property of the form should be set to FixedDiaiog.
+ The ControlBox, MinimizeBox, and MaximizeBox properties should be set to False.
+ The form must provide the OK and Cancel buttons to either close the dialog box or cancel
any tasks within the dialog box.
+ The AcceptButton property of the form should be used to set the OK button.
+ The CancelButton property of the form should be used to set the Cancel button.
Slide 23 of 2609/20/13
Slide 24 of 2609/20/13
Retrieving Information from a Dialog Box
The form that displays the dialog box can retrieve the result of that dialog box by referencing
its DialogResult property.
"DialogResult" Enumeration

More Related Content

PDF
Chapter 10.1.5
PPTX
Controls Use in Windows Presentation Foundation (WPF)
DOC
Access5
DOC
Vista Users Guide
PPTX
Access chapter 1
PPTX
Microsft excel 2007 ( ict )
PPT
Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT
DOC
Access4
Chapter 10.1.5
Controls Use in Windows Presentation Foundation (WPF)
Access5
Vista Users Guide
Access chapter 1
Microsft excel 2007 ( ict )
Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT
Access4

What's hot (17)

PDF
Access advanced tutorial
DOC
Acccesss notes
PDF
Lotusnotesv85referenceguide
PPTX
MS ACCESS (REPORT)
PPT
Unit B Windows 7
PPTX
Gl13 m7-c3-presentation
PPTX
Treeview listview
PDF
Customizing Forms
PPT
Buttons In .net Visual Basic
DOCX
Basic knowledge of computers
DOCX
Common dialog control
PDF
Bigcommerce template guide_1.1
PPTX
2 1 working in an end note library
PDF
User interface introduction openbravo
PDF
SJI6510_Authoring _With_Structured_FrameMaker
PDF
Lesson 3 getting familiar with xp
Access advanced tutorial
Acccesss notes
Lotusnotesv85referenceguide
MS ACCESS (REPORT)
Unit B Windows 7
Gl13 m7-c3-presentation
Treeview listview
Customizing Forms
Buttons In .net Visual Basic
Basic knowledge of computers
Common dialog control
Bigcommerce template guide_1.1
2 1 working in an end note library
User interface introduction openbravo
SJI6510_Authoring _With_Structured_FrameMaker
Lesson 3 getting familiar with xp
Ad

Viewers also liked (20)

PPTX
Customize word background
PPTX
Picture toolbar
PPTX
Working with dialog box and working with web page
PDF
Shortcuts (Computer commannds)
PPT
Computer shortcuts
PPTX
Notepad
 
PPTX
Presentacion
PPTX
WORDPAD
PPTX
Search Engine Training Institute in Ambala!Batra Computer Centre
PPTX
Internet features (2nd topic)
PPTX
Basic shortcut keys of computer or PC
PPT
Features Of The Internet
PDF
how the internet works
PPTX
Full Presentation on Notepad
PPS
Notepad Presentation Mca
PPT
Notepad
PPT
Ms Paint
PPT
Word pad
PPTX
Ms paint tutorial
PPTX
Microsoft Paint Powerpoint
Customize word background
Picture toolbar
Working with dialog box and working with web page
Shortcuts (Computer commannds)
Computer shortcuts
Notepad
 
Presentacion
WORDPAD
Search Engine Training Institute in Ambala!Batra Computer Centre
Internet features (2nd topic)
Basic shortcut keys of computer or PC
Features Of The Internet
how the internet works
Full Presentation on Notepad
Notepad Presentation Mca
Notepad
Ms Paint
Word pad
Ms paint tutorial
Microsoft Paint Powerpoint
Ad

Similar to Session 5 Bai 5 ve winform (20)

PPT
4.1 Thecast by roshan kumar sah lecture slide
PPTX
Visual programming is a type of programming
PPTX
Windowforms controls c#
PPTX
Windows Dialog Boxes - R.D.Sivakumar
PPTX
Visual Basic Controls ppt
PPT
VB.Net GUI Unit_01
PPTX
Visual basic
PDF
Intake 38 9
PDF
Intake 37 9
PPTX
Visual basic
PPTX
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
PPTX
Visual Basic.pptx
PPTX
Working with Windows and Applications 2
PPT
PPSX
PPT
VB Dot net
PDF
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
PPT
Chapter 06
PPTX
Windows form application - C# Training
PPS
Vb6.0 Introduction
4.1 Thecast by roshan kumar sah lecture slide
Visual programming is a type of programming
Windowforms controls c#
Windows Dialog Boxes - R.D.Sivakumar
Visual Basic Controls ppt
VB.Net GUI Unit_01
Visual basic
Intake 38 9
Intake 37 9
Visual basic
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
Visual Basic.pptx
Working with Windows and Applications 2
VB Dot net
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Chapter 06
Windows form application - C# Training
Vb6.0 Introduction

More from mrtom16071980 (10)

PPTX
Bai giang-ms-excel-2010
PPTX
7314 l10 pwerpoint
PPT
hoc ve xml
PPT
Session 8 Bai 8 ve winform
PPT
Session 6 Bai 6 ve winform
PPT
Session 4 Bai 4 ve winform
PPT
Session 3 Bai 3 ve winform
PPT
Session 2 Bai 2 ve winform
PPT
Session 1. Bai 1 ve winform
PPT
Session 7 Bai 7 ve winform
Bai giang-ms-excel-2010
7314 l10 pwerpoint
hoc ve xml
Session 8 Bai 8 ve winform
Session 6 Bai 6 ve winform
Session 4 Bai 4 ve winform
Session 3 Bai 3 ve winform
Session 2 Bai 2 ve winform
Session 1. Bai 1 ve winform
Session 7 Bai 7 ve winform

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
1. Introduction to Computer Programming.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Spectroscopy.pptx food analysis technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
1. Introduction to Computer Programming.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectroscopy.pptx food analysis technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25-Week II
Advanced methodologies resolving dimensionality complications for autism neur...
Group 1 Presentation -Planning and Decision Making .pptx
20250228 LYD VKU AI Blended-Learning.pptx
Tartificialntelligence_presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
A comparative analysis of optical character recognition models for extracting...
Digital-Transformation-Roadmap-for-Companies.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Dropbox Q2 2025 Financial Results & Investor Presentation

Session 5 Bai 5 ve winform

  • 1. Session 5 Slide 1 of 1309/20/13 Dialog Boxes
  • 2. Slide 2 of 2609/20/13 Module Introduction + A dialog box is a special window, which can be used to interact with the user and display information. + It acts as a container that can hold various controls to retrieve information. + Dialog boxes are divided into two categories : - Common dialog boxes are system-defined dialog boxes - Custom dialog boxes are user-defined dialog boxes.
  • 3. Slide 3 of 2609/20/13 A dialog box is a window that allows you to collect and display related information using various controls. Some of the dialog boxes that you have used in Windows are Save As, Color, Print and Page Setup. Introduction to Dialog Boxes
  • 4. Slide 4 of 2609/20/13 Elements A dialog box consists of: • Title bar displaying caption and the close icon • Instruction text informing what the user should do (optional) • Content with controls to select or display information • Action area having buttons and link labels • Footnote area explaining about the window (optional)
  • 5. Slide 5 of 2609/20/13 Features A dialog box is different from forms because of some basic features. These are: + Non-resizable: A dialog box is not resizable and cannot be maximized or minimized. + Usually Modal: A dialog box is usually of modal type. This means that the user is not allowed to focus on any other window until the dialog box is closed. + Common Set of Buttons and Icons: a dialog box consists of some standard buttons such as OK and Cancel.It also consists of the Help and Close icons on its top-right corner.
  • 6. Slide 6 of 2609/20/13 Modal Dialog Box There are two types of dialog boxes namely : modal and modeless. + A modal dialog box does not allow the user to activate any other window in the application unless the dialog box is closed. + A modeless dialog box allows user to focus and work with the same application without closing the dialog box.
  • 7. Slide 7 of 2609/20/13 Common and Custom Dialog Boxes + Common dialog boxes are system-defined dialog boxes such as Open, Save and Print. These dialog boxes are reusable and hence can be used across various applications. + Custom dialog boxes are user-defined dialog boxes. These dialog boxes are useful when the system-defined dialog boxes do not fulfill certain requirements.
  • 8. Slide 8 of 2609/20/13 "CommonDialog" Class The CommonDialog class is the base class for all common dialog boxes. This class exists in the System.Windows.Forms namespace.
  • 9. Slide 9 of 2609/20/13 "ColorDialog" Component The ColorDialog component is a dialog box that allows you to select system-defined colors from the color palette.
  • 10. Slide 10 of 2609/20/13 "ColorDialog" Class
  • 11. Slide 11 of 2609/20/13 "FontDialog" Component The FontDialog component allows you to select different fonts that are installed in the system.
  • 12. Slide 12 of 2609/20/13 "FontDialog" Class
  • 13. Slide 13 of 2609/20/13 "OpenFileDialog" and "SaveFileDialog" Components The OpenFileDialog and SaveFileDialog are the most commonly used dialog boxes in applications. The OpenFileDialog component allows you to open a file and the SaveFileDialog component allows you to save a file.
  • 14. Slide 14 of 26 09/20/13 "OpenFileDialog" Class
  • 15. Slide 15 of 2609/20/13 "SaveFileDialog" Class
  • 16. Slide 16 of 2609/20/13 "PageSetupDialog" Component The PageSetupDialog component is a system-defined dialog box, which allows the user to set the page layout for printing. It provides various options such as the border and margin adjustments, headers and footers, and portrait and landscape orientation for the page to be printed.
  • 17. Slide 17 of 2609/20/13 "PageSetupDialog" Class
  • 18. Slide 18 of 2609/20/13 "PrintDialog" Component The PrintDialog component is a system-defined dialog box that allows you to print the documents.
  • 19. Slide 19 of 2609/20/13 "PrintDialog" Class
  • 20. Slide 20 of 2609/20/13 "PrintPreviewDialog" Control The PrintPreviewDialog control is used to display the way a document will appear when printed.
  • 21. Slide 21 of 2609/20/13 "PrintPreviewDialog" Class
  • 22. Slide 22 of 2609/20/13 User-Defined Dialog Boxes A system-defined dialog box does not always fulfill the requirements of the developers and users. In such cases, a developer needs to create custom dialog boxes to fulfill the requirements. To do so, you can convert a form into a user-defined dialog box. To create a user-defined dialog box: + The FormBorderStyle property of the form should be set to FixedDiaiog. + The ControlBox, MinimizeBox, and MaximizeBox properties should be set to False. + The form must provide the OK and Cancel buttons to either close the dialog box or cancel any tasks within the dialog box. + The AcceptButton property of the form should be used to set the OK button. + The CancelButton property of the form should be used to set the Cancel button.
  • 23. Slide 23 of 2609/20/13
  • 24. Slide 24 of 2609/20/13 Retrieving Information from a Dialog Box The form that displays the dialog box can retrieve the result of that dialog box by referencing its DialogResult property. "DialogResult" Enumeration