C # font selection and color dialog box

13 days daily one case 2020-03-23

1. New dialog box, drag the Textbox / label / button;

 

 

2. "Select font" button code;

 

 

FontDialog ff = new FontDialog();
if (ff.ShowDialog()==DialogResult.OK)
{
text4.Text = ff.Font.FontFamily.ToString();
}

 

 

3. "Color Select" button code;

ColorDialog cd = new ColorDialog();
if (cd.ShowDialog()==DialogResult.OK)
{
text5.Text = cd.Color.ToString();
}

 

4. The results are shown;

 

 

 

 

Guess you like

Origin www.cnblogs.com/ljs7490/p/12556160.html