Verify.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using CCWin;
  2. using SXLibrary;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace MOKA_Factory_Tools
  13. {
  14. public partial class Verify : Skin_Color
  15. {
  16. private string _Msg = "";
  17. public Verify(string strMsg)
  18. {
  19. _Msg = strMsg;
  20. InitializeComponent();
  21. }
  22. /// <summary>
  23. /// 设置控件居中显示;
  24. /// </summary>
  25. /// <param name="ctrl"></param>
  26. private void SetControlCenter(Control ctrl)
  27. {
  28. // 注:由于CSkin控件的标准栏是自定义的,所以整个工作区与系统的对话框是有差别的。
  29. int x = (this.Width-ctrl.Width)/2;
  30. int y = (this.Height - ctrl.Height)/2;
  31. ctrl.Location = new Point(x, y);
  32. }
  33. private void Verify_Load(object sender, EventArgs e)
  34. {
  35. LB_MSG.Text = _Msg;
  36. LB_MSG.AutoSize = true;
  37. // 使控件居中显示;
  38. SetControlCenter(LB_MSG);
  39. }
  40. private void BT_OK_Click(object sender, EventArgs e)
  41. {
  42. Log.WriteInfoLog(string.Format("NG弹框被单击确定:{0}", _Msg));
  43. this.Close();
  44. }
  45. }
  46. }