代码改变世界

回车转tab

2008-07-01 08:33  Virus-BeautyCode  阅读(545)  评论(0编辑  收藏  举报
首先设置窗体的keypreview=true
然后再窗体的KeyPress事件中写上
if(e.KeyChar==13)
SendKeys.Send("{TAB}");

private void CollectPersonalInfo_KeyPress(object sender, KeyPressEventArgs e)
        
{
            
if (e.KeyChar == 13)
                SendKeys.Send(
"{tab}");
                
//this.SelectNextControl(this.ActiveControl, true, true, true, true);
        }