首页  编辑  

回车代替Tab

Tags: /C#/界面处理/TextBox_RichEdit/   Date Created:

protected override bool ProcessDialogKey( Keys keyData)

{

    if ((ActiveControl is TextBox || ActiveControl is ComboBox ) &&

       keyData == Keys . Enter)

   {

       keyData = Keys . Tab;

   }

    return base . ProcessDialogKey(keyData);

}