字體對話框,包括字體和字體顏色的設置
FontDialog fd = new FontDialog();
fd.ShowColor = true;
fd.Font = txtCmdInput.Font;
fd.Color = txtCmdInput.ForeColor;
if(fd.ShowDialog()!= DialogResult.Cancel)
{
txtCmdInput.Font = fd.Font;
txtCmdInput.ForeColor = fd.Color;
}
顏色對話框,設置控件背景色
ColorDialog cd = new ColorDialog();
cd.Color = txtCmdInput.BackColor;
if(cd.ShowDialog()!= DialogResult.Cancel)
{
txtCmdInput.BackColor = cd.Color;
}