FontDialog.ShowColor Property
.NET Framework 4
Gets or sets a value indicating whether the dialog box displays the color choice.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System.Booleantrue if the dialog box displays the color choice; otherwise, false. The default value is false.
The following code example uses ShowDialog to display a FontDialog. This code requires that a Form has already been created with a TextBox and button placed on it. It also requires that the fontDialog1 has been created. The Font contains the size information but not the color information.
private void button1_Click(object sender, System.EventArgs e) { fontDialog1.ShowColor = true; fontDialog1.Font = textBox1.Font; fontDialog1.Color = textBox1.ForeColor; if(fontDialog1.ShowDialog() != DialogResult.Cancel ) { textBox1.Font = fontDialog1.Font ; textBox1.ForeColor = fontDialog1.Color; } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.