首页 > 代码库 > C#重写OnKeyPress方法

C#重写OnKeyPress方法

   protected override void OnKeyPress(KeyPressEventArgs e)        {            if (e.KeyChar == 13)            {                this.SelectNextControl(this.ActiveControl, true, true, true, true);            }            base.OnKeyPress(e);        }        private void txt_UseName_KeyPress(object sender, KeyPressEventArgs e)        {            OnKeyPress(e);        }

 

C#重写OnKeyPress方法