日期:2014-05-18  浏览次数:20918 次

怎么实现两个textbox同步显示~~~~~~~
一个textbox改变后,另一个也呈现相应的改变?

------解决方案--------------------
TextChange事件中写:

string word=" 你我他";//注意前面有个空格
TextBox2.Text="";
foreach(char c in textBox1.Text)
{
textBox2.Text += word.IndexOf(c)+" ";
}
textBox2.Text=textBox2.Text.TrimEnd();//去除末尾多出的一个空格