Last change
on this file since 2594 was
1885,
checked in by mstoeger, 15 years ago
|
xaxis grid color can be set in the options dialog #555
|
File size:
994 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using System.ComponentModel;
|
---|
3 | using System.Drawing;
|
---|
4 | using System.Windows.Forms;
|
---|
5 |
|
---|
6 | namespace HeuristicLab.Visualization.Options {
|
---|
7 | public delegate void ColorChangedHandler(ColorSelection sender);
|
---|
8 |
|
---|
9 | [DefaultEvent("ColorChanged")]
|
---|
10 | public partial class ColorSelection : UserControl {
|
---|
11 | public ColorSelection() {
|
---|
12 | InitializeComponent();
|
---|
13 | }
|
---|
14 |
|
---|
15 | public event ColorChangedHandler ColorChanged;
|
---|
16 |
|
---|
17 | public Color Color {
|
---|
18 | get { return ColorPreviewTB.BackColor; }
|
---|
19 | set {
|
---|
20 | ColorPreviewTB.BackColor = value;
|
---|
21 | FireColorChanged();
|
---|
22 | }
|
---|
23 | }
|
---|
24 |
|
---|
25 | private void OptionsDialogSelectColorBtn_Click(object sender, EventArgs e) {
|
---|
26 | ColorDialog dlg = new ColorDialog();
|
---|
27 | if (dlg.ShowDialog() == DialogResult.OK) {
|
---|
28 | ColorPreviewTB.BackColor = dlg.Color;
|
---|
29 | FireColorChanged();
|
---|
30 | }
|
---|
31 | }
|
---|
32 |
|
---|
33 | private void FireColorChanged() {
|
---|
34 | if (ColorChanged != null)
|
---|
35 | ColorChanged(this);
|
---|
36 | }
|
---|
37 | }
|
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.