WPF 颜色选择器

2021-02-05 05:15

阅读:406

标签:round   bsp   dial   rms   选择器   orm   nbsp   window   tran   

 

 

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;
}

WPF 颜色选择器

标签:round   bsp   dial   rms   选择器   orm   nbsp   window   tran   

原文地址:https://www.cnblogs.com/wlming/p/14360543.html


评论


亲,登录后才可以留言!