Beispiel #1
0
        private void Button_Color(object sender, System.Windows.RoutedEventArgs e)
        {
            ColorDialog colorDialog = ColorDialog.GetInstance();

            colorDialog.Color = this.Config.DWMBackgroundColor;
            // Using the parent to make sure the dialog doesn't show on another window
            colorDialog.ShowDialog();
            if (colorDialog.DialogResult != System.Windows.Forms.DialogResult.Cancel)
            {
                if (!colorDialog.Color.Equals(this.Config.DWMBackgroundColor))
                {
                    this.Config.DWMBackgroundColor.Value = colorDialog.Color;
                }
            }
        }
Beispiel #2
0
        private void ColorButtonClick(object sender, EventArgs e)
        {
            ColorDialog colorDialog = ColorDialog.GetInstance();

            colorDialog.Color = SelectedColor;
            // Using the parent to make sure the dialog doesn't show on another window
            colorDialog.ShowDialog(Parent.Parent);
            if (colorDialog.DialogResult != DialogResult.Cancel)
            {
                if (!colorDialog.Color.Equals(SelectedColor))
                {
                    SelectedColor = colorDialog.Color;
                    if (PropertyChanged != null)
                    {
                        PropertyChanged(this, new PropertyChangedEventArgs("SelectedColor"));
                    }
                }
            }
        }
 public ColorPickerToolStripButton()
 {
     cd          = ColorDialog.GetInstance();
     this.Click += new System.EventHandler(this.ToolStripButton1Click);
 }