ucResHmpPlan.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Infragistics.Win;
  10. namespace Core.StlMes.Client.LgCommon
  11. {
  12. public partial class ucResHmpPlan : ucResBase
  13. {
  14. public ucResHmpPlan()
  15. {
  16. InitializeComponent();
  17. }
  18. private void ucResHmpPlan_Load(object sender, EventArgs e)
  19. {
  20. try
  21. {
  22. ClsControlPack.SetUltraGridStyle(ultraGrid1, 2); //设置样式
  23. ValueList vlist = ClsBusinessPack.GetValuelistMolirnLeave();
  24. ClsControlPack.SetGridValuelist(ref ultraGrid1, "MOLIRNLEAVE", ref vlist);
  25. }
  26. catch { }
  27. }
  28. private void ultraGrid1_KeyPress(object sender, KeyPressEventArgs e)
  29. {
  30. string strKey = this.ultraGrid1.ActiveCell.Column.ToString();
  31. if (strKey == "POTAGE" || strKey == "IRONPWRAPNO")
  32. {
  33. if (!(e.KeyChar == '\b') && ultraGrid1.ActiveRow.Cells[strKey].Value.ToString().Length >= 6)
  34. {
  35. e.Handled = true;
  36. }
  37. if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b'))
  38. {
  39. e.Handled = true;
  40. }
  41. }
  42. }
  43. }
  44. }