This article is based on the original article that was previously written using an older version of Visual Studio. You can find the original article on the given below link:
Let's suppose that we have a windows form with RitchTextBox and four buttons (Color, Font, SaveFile, OpenFile), with four different Dialogs (ColorDialog, FontDialog, SaveDialog, OpenDialog,).
Example as given below: Figure 1

ColorDialog:
In C#, setting colors of controls is a piece of cake. The ColorDialog class does everything for you. The ColorDialog is derived from common dialog. ShowDialog displays color dialog and let you pick a color. Color property of the ColorDialog returns the current selected color.

Design-time:
To create a ColorDialogcontrol at design-time, you simply drag and drop a ColorDialogcontrol from Toolbox to a Form in Visual Studio. After you drag and drop a ColorDialog on a Form, the ColorDialog looks like:

After dropping the colordialog on form we will write the code to show the colordialog on button click,
Code C#:
- private void button1_Click(object sender, EventArgs e)
- {
- colorDialog1.ShowDialog();
- richTextBox1.SelectionColor = colorDialog1.Color;
- }
A FontDialog control is used to select a font from available fonts installed on a system. A typical Font Dialog looks like Figure 3 where you can see there is a list of fonts, styles, size and other options. Please note a FontDialog may have different fonts on different system depending on what fonts are installed on a system.
We can create a FontDialog control using a Forms designer at design-time or using the FontDialog class in code at run-time (also known as dynamically). Unlike other Windows Forms controls, a FontDialog does not have and does not need visual properties like others. You use a FontDialog to list all the fonts and select one of them and usually apply selected fonts on controls or some contents.

Design-time:
To create a FontDialog control at design-time, you simply drag and drop a FontDialog control from Toolbox to a Form in Visual Studio. After you drag and drop a FontDialog on a Form, the FontDialog looks like,

After drop the fontDialog on form we will write the code to show the fontDialog on button click,
Code C#:
- private void button2_Click(object sender, EventArgs e)
- {
- fontDialog1.ShowDialog();
- richTextBox1.SelectionFont = fontDialog1.Font;
- }




Vignesh ManiPosted Mar 14, 2016, 5:52 PM
nice
Kashif SohailPosted Mar 12, 2016, 5:17 AM
it is same as it was before. nothing new
Anu VPosted Mar 11, 2016, 6:02 AM
Nice
Afzaal Ahmad ZeeshanPosted Mar 11, 2016, 5:07 AM
How is that related to C# 6?
Sibeesh VenuPosted Mar 11, 2016, 4:45 AM
Nice Share