颜色拾取
/// <summary>
/// 颜色拾取
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void color_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();
colorDialog.SolidColorOnly = true;
if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
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));
(sender as System.Windows.Controls.Button).Background = solidColorBrush;
}
}