/// <summary> /// 医嘱服务查询输入框值失去焦点 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// Author:hums /// Date:2016-05-10 protected override void TextboxOnLostFocus(object sender, EventArgs e) { // 恢复输入框默认状态 if (string.IsNullOrEmpty(this.ValueText)) { //this.ValueText = defDisplayText; //this.ForeColor = Color.FromArgb(188, 188, 188); } if (resultFrm != null && resultFrm.Created) { if (resultFrm.Handle != GetForegroundWindow()) { if (resultFrm != null && resultFrm.Created && !this.IsFocus) { if (Shoutflag) { resultFrm.Hide(); } Shoutflag = true; } } } if (form != null) { if (form.Handle != GetForegroundWindow()) { if (form != null && form.Created) { form.Hide(); } } } base.TextboxOnLostFocus(sender, e); }
void TextBox_LostFocus(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.TextBox.Text)) { this.TextBox.Text = "常用模板"; this.TextBox.ForeColor = Color.FromArgb(188, 188, 188); } if (frm != null) { //if (frm.Handle != GetForegroundWindow()) //{ // if (frm != null && frm.Created && !this.TextBox.Focused) // { // if (Shoutflag) // { // frm.Hide(); // } // Shoutflag = true; // } //} } if (form != null) { if (form.Handle != GetForegroundWindow()) { if (form != null && form.Created && !this.TextBox.Focused) { if (Secondflag) { form.Hide(); } Secondflag = true; } } } }