ProjectName.cs 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Windows.Forms;
  3. using CoreFS.CA06;
  4. namespace Core.StlMes.Client.LgResMgt.Mcms
  5. {
  6. public partial class ProjectName : FrmBase
  7. {
  8. public ProjectName(string text)
  9. {
  10. InitializeComponent();
  11. this.Text = text;
  12. lblshow.Text = text;
  13. }
  14. public string ProjectNameStr
  15. {
  16. get { return uteProjectName.Text; }
  17. set { uteProjectName.Text = value; }
  18. }
  19. private void ubtOK_Click(object sender, EventArgs e)
  20. {
  21. if (string.IsNullOrWhiteSpace(uteProjectName.Text))
  22. {
  23. MessageBox.Show(@"请输入" + this.Text);
  24. return;
  25. }
  26. this.DialogResult = DialogResult.OK;
  27. }
  28. private void uteProjectName_KeyPress(object sender, KeyPressEventArgs e)
  29. {
  30. if (e.KeyChar == 13)
  31. {
  32. ubtOK_Click(null, null);
  33. }
  34. }
  35. }
  36. }