111,131
社区成员
发帖
与我相关
我的任务
分享
private void ItemTextBox_KeyDown(object sender, KeyEventArgs e)
{
///按下回车键
if (e.KeyCode == Keys.Enter)
{
this.GetAssignButton.PerformClick(); //在这里一可以选择光标移动到目标地方
}
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
//改下面这句为你的条件...
if (e.KeyChar == (Char)13)
{
if (!this.Multiline)
SendKeys.Send("{Tab}");
}
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
//将下面这句改一下就成了.到下一个控件...不论下一个控件是什么.
if (e.KeyChar == (Char)13) {
SendKeys.Send("{Tab}");
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (this.textBox1.Text.Length >= 6)
{
this.textBox2.Focus();
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Length == 6)
{
this.ActiveControl = textBox2;
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (this.textBox1.Text.Length > 5)
{
this.textBox2.Focus();
}
}if(textbox.selectionstart==7)