System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();
//允许使用该对话框的自定义颜色
colorDialog.AllowFullOpen = true;
colorDialog.FullOpen = true;
colorDialog.ShowHelp = true;
if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string strColor = System.Drawing.ColorTranslator.ToHtml(colorDialog.Color);
tbBackgroundColor.Text = strColor;
//System.Drawing.SolidBrush sb = new System.Drawing.SolidBrush(colorDialog.Color);
//SolidColorBrush solidColorBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(sb.Color.A, sb.Color.R, sb.Color.G, sb.Color.B));
//this.Background = solidColorBrush;
}