3
失去焦點事件代碼:動力損失焦點事件的文本框拋出錯誤
public void myTextBox_LostFocus(object sender, System.Windows.Input.GestureEventArgs e)
{
string name = ((TextBox)sender).Name;
string strl = "tbox" + name.Substring(4);
TextBox text = FindTextBoxByName(strl);
text.HorizontalAlignment = HorizontalAlignment.Left;
text.Width = 50;
text.Height = 40;
}
事件電話: -
myTextBox1j.LostFocus += new EventHandler<GestureEventArgs>(myTextBox_LostFocus);
拋出以下錯誤: - 無法隱式轉換type'System.EventHandler '到'System.Windows.RoutedEventHandler'