ProcessDialogKey 方法实现回车自动换行

protected override bool ProcessDialogKey(Keys keyData)
        {
            //实现回车跳到下一控件
            if ((ActiveControl is TextBox || ActiveControl is ComboBox || ActiveControl is DateTimePicker) &&

                    keyData == Keys.Enter)
            {

                keyData = Keys.Tab;

            }
            return base.ProcessDialogKey(keyData);
        }

posted @ 2011-08-10 21:06  Lance Yang  阅读(367)  评论(0编辑  收藏  举报