اینم کد البته با Enter فوکوس و عوض میکنه میتونید شرط رو عوض کنید
TextBox textBox1;
TextBox textBox2;
TextBox textBox3;
privatevoid Form1_Load(object sender, EventArgs e)
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
this.textBox1.Location = new System.Drawing.Point(70, 104);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(70, 20);
this.textBox1.TabIndex = 0;
this.textBox1.KeyDown += newKeyEventHandler(this.textBox1_KeyDown);
// textBox2
this.textBox2.Location = new System.Drawing.Point(140, 104);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(70, 20);
this.textBox2.TabIndex = 1;
this.textBox2.KeyDown += newKeyEventHandler(this.textBox2_KeyDown);
// textBox3
this.textBox3.Location = new System.Drawing.Point(210, 104);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(70, 20);
this.textBox3.TabIndex = 2;
this.textBox3.KeyDown += newKeyEventHandler(this.textBox3_KeyDown);
//------------------------------
this.Controls.Add(textBox1);
this.Controls.Add(textBox2);
this.Controls.Add(textBox3);
}
privatevoid textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
SendKeys.Send("{TAB}");
}
privatevoid textBox2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
SendKeys.Send("{TAB}");
}
privatevoid textBox3_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
SendKeys.Send("{TAB}");
}