如何定位多个textbox的异常
比如多个textbox有个textbox输入的信息过长,抛出了异常,但是我不知道是哪个textbox,我想定位最后把光标定位到那里
------解决方案--------------------txtInput1.TextChanged+=txtInput_TextChanged;
txtInput2.TextChanged+=txtInput_TextChanged;
txtInput3.TextChanged+=txtInput_TextChanged;
txtInput4.TextChanged+=txtInput_TextChanged;
void txtInput_TextChanged(object sender,e)
{
TextBox goal = sender as TextBox;
// ...
//goal即为发生异常的textbox
goal设置焦点
}