if(e.KeyValue ==13)
{
txtPwd.Select();//txtPwd为下一个文本框
}
{
txtPwd.Select();//txtPwd为下一个文本框
}
解决方案 »
- visual c# 2008 express edition和vs2008有区别么?
- 关于表中多字段问题
- 复选框跑偏
- 一个网页编码的问题!大家来讨论下!
- Datagrid取选择一行的 某列的值.
- Winform中如何处理窗口右上角的"最小化"事件?
- 关于用c#读取、另存excel的问题。
- 用FindWindowEx能遍历一个窗体的所有元素吗??怎么搞?
- 关于asp.net Global.asax 的 Application_Start 定时器,运行一定时间之后,程序就自动关闭了。
- 如何将SQL里面的数据导入到ACCESS里面 最好不通过Dataset等中间虚拟表
- 能否将DataGrid里面的数据以表格的形式打印出来
- 如何格式化excel表格
if( e.KeyCode = Keys.Enter)
{
SendKeys.Send("{TAB}");
}
那么如下:
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
checkBox1.Focus();
}
} private void checkBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
button1.Focus();
}
}
应该没问题的!
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode==Keys.Enter )
{
SendKeys.Send("{TAB}");
}
}