Verify.cs 1.2 KB

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