private void imgSearchMpID_MouseUp(object sender, MouseButtonEventArgs e) { try { Module.Forms.FrmSearchMp lo_FrmSearchMp = new Module.Forms.FrmSearchMp(); if (lo_FrmSearchMp.ShowDialog() == true) { string ls_mpID = lo_FrmSearchMp.Tag.ToString(); txtsMpID.Text = ls_mpID; KeyEventArgs keyEventArgs = new KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Enter); txtsMPName_KeyDown(txtsMpID, keyEventArgs); } } catch (Exception lo_Ex) { string ls_ErrMsg = ls_TitleName + " imgSearchMpID_MouseUp Error,Message is " + lo_Ex.Message + " --> " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); #region 錯誤的LOG處理 StringBuilder lo_StringBuilder = new StringBuilder(); lo_StringBuilder.AppendLine(ls_ErrMsg); BaseHelper.WriteLog(lo_StringBuilder); #endregion MessageBox.Show(ls_ErrMsg, ls_TitleName, MessageBoxButton.OK, MessageBoxImage.Error); } }