using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Infragistics.Win; namespace Core.StlMes.Client.LgCommon { public partial class ucResHmpPlan : ucResBase { public ucResHmpPlan() { InitializeComponent(); } private void ucResHmpPlan_Load(object sender, EventArgs e) { try { ClsControlPack.SetUltraGridStyle(ultraGrid1, 2); //设置样式 ValueList vlist = ClsBusinessPack.GetValuelistMolirnLeave(); ClsControlPack.SetGridValuelist(ref ultraGrid1, "MOLIRNLEAVE", ref vlist); } catch { } } private void ultraGrid1_KeyPress(object sender, KeyPressEventArgs e) { string strKey = this.ultraGrid1.ActiveCell.Column.ToString(); if (strKey == "POTAGE" || strKey == "IRONPWRAPNO") { if (!(e.KeyChar == '\b') && ultraGrid1.ActiveRow.Cells[strKey].Value.ToString().Length >= 6) { e.Handled = true; } if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b')) { e.Handled = true; } } } } }