void state_button_Click(object sender, EventArgs e) { this.EditAction = "changestate"; if (this.WantFocus != null) { WantFocusEventArgs e1 = new WantFocusEventArgs(); this.WantFocus(this, e1); } }
void BiblioControl1_WantFocus(object sender, WantFocusEventArgs e) { if (e.Focus == true) { this.CommentsControl1.Active = false; } else { this.CommentsControl1.Active = true; } }
void cancel_button_Click(object sender, EventArgs e) { this.EditAction = ""; this.ClearEdit(); if (this.WantFocus != null) { WantFocusEventArgs e1 = new WantFocusEventArgs(); e1.Focus = false; // 不再独占Focus this.WantFocus(this, e1); } }
void commentcontrol_WantFocus(object sender, WantFocusEventArgs e) { // 最后有函数统一设置了,这里就不用作了 /* * CommentControl source = (CommentControl)sender; * List<Control> controls = BrowseSearchResultControl.FindControl(this, * typeof(CommentControl)); * * // 找到sender对象以外的其他CommentControl对象,把它们设置为Active = false的状态 * foreach (Control control in controls) * { * CommentControl comment_control = (CommentControl)control; * if (comment_control == source) * { * comment_control.Active = true; * } * else * { * comment_control.Active = false; * } * } * * // 找到所有BiblioControl对象 * controls = BrowseSearchResultControl.FindControl(this, * typeof(BiblioControl)); * * // 把它们设置为Active = false的状态 * foreach (Control control in controls) * { * BiblioControl biblio_control = (BiblioControl)control; * biblio_control.Active = false; * } * * // 隐藏底部的cmdline中的按钮 * EnableCmdButtons(false); * m_bButtonSetted = true; * */ /* * // 把底部的editor隐藏 * CommentControl editor = (CommentControl)this.FindControl("editor"); * editor.Visible = false; * * // 继续发给父对象 * if (this.SetActive != null) * { * SetActiveEventArgs e1 = new SetActiveEventArgs(); * this.SetActive(this, e1); * } * */ }
void bibliocontrol_WantFocus(object sender, WantFocusEventArgs e) { }