Beispiel #1
0
 private void enterBtn_Click(object sender, EventArgs e)
 {
     int result = int.Parse(inputContent.Text);
     if (result >= min && result <= max)
     {
         this.Owner.Tag = inputContent.Text;
         this.Close();
     }
     else
     {
         WarningForm form = new WarningForm("WARNING!!! INVALID PARAMETER.\nPlease check allowable range.");
         form.ShowDialog();
     }
 }
Beispiel #2
0
 private void enterBtn_Click(object sender, EventArgs e)
 {
     int iResult = MainForm.LabelTextToInt(inputContent.Text, factor);
     if (iResult >= min && iResult <= max)
     {
         this.Owner.Tag = MainForm.IntToLabelText(iResult, factor);
         this.Close();
     }
     else
     {
         WarningForm form = new WarningForm("WARNING!!! INVALID PARAMETER.\nPlease check allowable range.");
         form.ShowDialog();
     }
 }
 private void enterBtn_Click(object sender, EventArgs e)
 {
     String resultStr = "";
     if (inputContent.Text != "----" && inputContent.Text != "")
     {
         resultStr = inputContent.Text;
     }
     float min = 0;
     float max = 0;
     float result = float.Parse(resultStr);
     if ("Kpa" == this.unit)
     {
         min = float.Parse(minKpa);
         max = float.Parse(maxKpa);
     }
     else if ("bar" == this.unit)
     {
         min = float.Parse(minBar);
         max = float.Parse(maxBar);
     }
     else
     {
         min = float.Parse(minPsi);
         max = float.Parse(maxPsi);
     }
     if (result >= min && result <= max)
     {
         this.Owner.Tag = new String[] {result.ToString(), this.unit};
         this.Close();
     }
     else
     {
         WarningForm form = new WarningForm("WARNING!!! INVALID PARAMETER.\nPlease check allowable range.");
         form.ShowDialog();
     }
 }