private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (textBox1.Text.Trim() != "")
{
if //敲回车键 ....这里怎么写 ?
{
button2.Focus();
}
}
}
{
if (textBox1.Text.Trim() != "")
{
if //敲回车键 ....这里怎么写 ?
{
button2.Focus();
}
}
}
{
if (e.KeyChar == (char)13)
{
button2.Focus();
}
}
...谢谢各位好心。
我其实只是需要那么一点点提示...刚从Delphi转行过来学 C# .net
{
if (e.KeyCode==Keys.Enter )
{
textBox2.Focus();
}
}
{
if (textBox1.Text.Trim() != null)
{
if (e.KeyCode==Keys.Enter )
{
textBox2.Focus();
}
} }
{
if (textBox1.Text.Trim() != "")
{
//Enter
if (e.KeyCode==Keys.Enter)
{
textBox2.Focus();
}
} }