2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace SeciControls.Graphing
14 public Double Min = Double.NaN;
15 public Double Max = Double.NaN;
19 InitializeComponent();
24 if (Double.IsNaN(Min))
26 chkMin.Checked =
true;
31 chkMin.Checked =
false;
32 txtMin.Text = Min.ToString();
35 if (Double.IsNaN(Max))
37 chkMax.Checked =
true;
42 chkMax.Checked =
false;
43 txtMax.Text = Max.ToString();
49 txtMin.Enabled = !chkMin.Checked;
54 txtMax.Enabled = !chkMax.Checked;
66 if (!Double.TryParse(txtMin.Text, out result))
68 MessageBox.Show(
"Minimum value is not valid",
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
82 if (!Double.TryParse(txtMax.Text, out result))
84 MessageBox.Show(
"Maximum value is not valid",
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
91 if (!chkMin.Checked && !chkMax.Checked && Min == Max)
93 MessageBox.Show(
"Minimum and Maximum values must be different!",
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
104 DialogResult = DialogResult.OK;
void GraphLimitsDialog_Load(object sender, EventArgs e)
void btnOK_Click(object sender, EventArgs e)
void chkMin_CheckedChanged(object sender, EventArgs e)
void chkMax_CheckedChanged(object sender, EventArgs e)