A FontDialog control is used to select a font from available fonts installed on a system.
In this tutorial we will change label color using by font dialog. If you want to show color panel in dialog, set as dialog.ShowColor = true
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | private void button1_Click(object sender, EventArgs e) { FontDialog fontDialog = new FontDialog(); fontDialog.ShowColor = true; //color pnael fontDialog.ShowApply = true; //show apply button fontDialog.ShowEffects = true; //after appling, label style will chance if (fontDialog.ShowDialog() != DialogResult.Cancel) { label1.Font = fontDialog.Font; label1.Font = fontDialog.Font; label1.ForeColor = fontDialog.Color; } |