110,534
社区成员
发帖
与我相关
我的任务
分享
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Focused)
{
textBox2.Text = textBox1.Text + "xxx";
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
if (textBox2.Focused)
{
textBox1.Text = textBox2.Text + "xxx";
}
}
用KeyPress事件来处理
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
this.textBox2.Text = this.textBox1.Text + "XXX";
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
this.textBox1.Text = this.textBox2.Text + "XXX";
}