Summary description for ColorChooser.
상속: System.Windows.Forms.Form
예제 #1
0
 private static Color ShowColorDialog(Color color)
 {
     using (var dialog = new ColorChooserForm())
     {
         dialog.Color = color;
         return dialog.ShowDialog() == DialogResult.OK ? dialog.Color : color;
     }
 }
예제 #2
0
 private static Color GetColor(Color color)
 {
     using (var dialog = new ColorChooserForm())
     {
         dialog.Color = color;
         if (dialog.ShowDialog() == DialogResult.OK)
             color = dialog.Color;
     }
     return color;
 }
 private void panelColor_DoubleClick(object sender, EventArgs e)
 {
     using (var dialog = new ColorChooserForm())
     {
         dialog.AlphaEnabled = false;
         Color c = this.panelColor.BackColor;
         dialog.Color = Color.FromArgb(255, c.R, c.G, c.B);
         if (dialog.ShowDialog() == DialogResult.OK)
             this.panelColor.BackColor = dialog.Color;
     }
 }
예제 #4
0
 private void panelColor_DoubleClick(object sender, EventArgs e)
 {
     string tag = (sender as Control).Tag.ToString();
     Color color;
     switch (tag)
     {
         case "START":
             color = this.panelStartColor.BackColor;
             break;
         case "END":
             color = this.panelEndColor.BackColor;
             break;
         default:
             color = this.panelTextColor.BackColor;
             break;
     }
     using (var dialog = new ColorChooserForm())
     {
         dialog.Color = color;
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             if (tag == "START") this.CurrentGradient.StartColor = dialog.Color;
             else if (tag == "END") this.CurrentGradient.EndColor = dialog.Color;
             this.RefreshDisplay();
         }
     }
 }
예제 #5
0
 private void ButtonColorClick(object sender, EventArgs e)
 {
     using (var dialog = new ColorChooserForm())
     {
         dialog.AlphaEnabled = false;
         dialog.Color = Editor.Settings.ImageColorSettings.BackgroundColor.ToSystemColor();
         if (dialog.ShowDialog() != DialogResult.OK) return;
         Editor.Settings.ImageColorSettings.BackgroundColor = dialog.Color.ToXnaColor();
         this.pictureBox.ImageBackColor = Editor.Settings.ImageColorSettings.BackgroundColor;
     }
 }
예제 #6
0
 private void ListBoxColorsDoubleClick(object sender, EventArgs e)
 {
     var index = this.listBoxColors.SelectedIndex;
     if (index < 0) return;
     using (var dialog = new ColorChooserForm())
     {
         dialog.Color = Editor.Settings.Charting.Colors[index];
         dialog.AlphaEnabled = false;
         if (dialog.ShowDialog(Windows.ChartSettingsForm) != DialogResult.OK) return;
         this.listBoxColors.DataSource = null;
         Editor.Settings.Charting.Colors[index] = dialog.Color;
         this.RefreshColors();
     }
 }
예제 #7
0
 private void ButtonAddClick(object sender, EventArgs e)
 {
     using (var dialog = new ColorChooserForm())
     {
         dialog.Color = Color.White;
         if (dialog.ShowDialog() != DialogResult.OK) return;
         Editor.Settings.Charting.Colors.Add(dialog.Color);
         this.RefreshColors();
     }
 }