C# 调用 colorDialog, 列举 字体

private void btnColor_Click(object sender, EventArgs e) { Button btn = sender as Button; ColorDialog colorDialog = new ColorDialog(); colorDialog.AllowFullOpen = true; colorDialog.FullOpen = true; colorDialog.ShowHelp = true; colorDialog.Color = Color.Black;//初始化当前文本框中的字体颜色,当用户在ColorDialog对话框中点击/"取消/"按钮 colorDialog.ShowDialog(); btn.BackColor = colorDialog.Color; } private void InitFontFamily() { for (int i = FontFamily.Families.GetLowerBound(0); i <= FontFamily.Families.GetUpperBound(0); i++) { this.listBox1.Items.Add(FontFamily.Families[i].Name); } }

你可能感兴趣的:(object,C#,button)