十万火急! 三个文本框,textbox1,textbox2,textbox3,初始化时候给textbox3一个字符串,比如000000,如果现在需要在改变textbox1里文本的时候,textbox3前三个字符跟这变化,改变textbox2的时候后三位跟着变化,该怎么解决。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 textbox1的textchanged事件:textbox3.text = textbox1.text + textbox3.text.substring(3,6)textbox2的textchanged事件:textbox3.text = textbox3.text.substring(0,3) + textbox2.text public Form1() { InitializeComponent(); this.textBox3.Text = "000000"; } private void textBox1_TextChanged(object sender, EventArgs e) { this.textBox3.Text = this.textBox1.Text.PadLeft(3, '0') + this.textBox3.Text.Substring(3, 3); } private void textBox2_TextChanged(object sender, EventArgs e) { this.textBox3.Text = this.textBox3.Text.Substring(0, 3) + this.textBox2.Text.PadRight(3, '0'); } 一楼的问题多多,如果1,2两个textbox没有输满三位会出现什么问题。思路是对的。 大文件上传NeatUpload问题 分页存储过程 返回记录总数问题.... c#連接SQL Server的問題 在VS.NET2003的C#中把EXCEL2000的数据导入SQL-SERVER2000的问题? (50分) Context的问题! 本人原来用vc开发,现初用C#,请问几个问题? .net程序,现在从浏览器上一打开是乱码?为什么? openSSH 下载大文件速度很慢 如何验证按值传递参数时,使用struct做参数与使用class做参数的区别? 谁养蛇的算法 C#的参数传递 关于ADO.NET 中Updata的问题
textbox3.text = textbox1.text + textbox3.text.substring(3,6)
textbox2的textchanged事件:
textbox3.text = textbox3.text.substring(0,3) + textbox2.text
{
InitializeComponent();
this.textBox3.Text = "000000";
} private void textBox1_TextChanged(object sender, EventArgs e)
{
this.textBox3.Text = this.textBox1.Text.PadLeft(3, '0') + this.textBox3.Text.Substring(3, 3);
} private void textBox2_TextChanged(object sender, EventArgs e)
{
this.textBox3.Text = this.textBox3.Text.Substring(0, 3) + this.textBox2.Text.PadRight(3, '0');
}