frmInputDecimal.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. namespace Core.LgMes.Client.LgJobMgt
  9. {
  10. public partial class frmInputDecimal : Form
  11. {
  12. public frmInputDecimal()
  13. {
  14. InitializeComponent();
  15. }
  16. private void frmInputDecimal_Load(object sender, EventArgs e)
  17. {
  18. try
  19. {
  20. this.ultraCalculator1.Text = _defaultValue;
  21. }
  22. catch
  23. {
  24. this.ultraCalculator1.Text = "";
  25. }
  26. }
  27. public string _defaultValue = "";
  28. public bool _IsUpdate = false;
  29. private void button1_Click(object sender, System.EventArgs e)
  30. {
  31. try
  32. {
  33. float f = Convert.ToSingle(this.ultraCalculator1.Text) * 1;
  34. }
  35. catch
  36. {
  37. MessageBox.Show("数字输入不正确,请修正。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
  38. return;
  39. }
  40. this._defaultValue = this.ultraCalculator1.Text;
  41. _IsUpdate = true;
  42. this.Close();
  43. }
  44. private void button2_Click(object sender, System.EventArgs e)
  45. {
  46. this.Close();
  47. }
  48. }
  49. }