如何处理SearchLookUpEdit中的FindClick事件

void searchLookUpEdit1_Popup(object sender, EventArgs e) { 
    IPopupControl popupControl = sender as IPopupControl;   
    LayoutControl layoutControl = popupControl.PopupWindow.Controls[2].Controls[0] as LayoutControl; 
    SimpleButton Button = ((LayoutControlItem)layoutControl.Items.FindByName("lciButtonFind")).Control as SimpleButton;
    if (Button != null)
      { Button.Click -= new EventHandler(button_Click); 
        Button.Click += new EventHandler(button_Click); 
      } 
 } 
  void button_Click(object sender, EventArgs e)
 { //your code 
  }
  void searchLookUpEdit1_QueryCloseUp(object sender, System.ComponentModel.CancelEventArgs e) 
{ 
    IPopupControl popupControl = sender as IPopupControl; 
    LayoutControl layoutControl = popupControl.PopupWindow.Controls[2].Controls[0] as LayoutControl;
    SimpleButton Button = ((LayoutControlItem)layoutControl.Items.FindByName("lciButtonFind")).Control as SimpleButton;
    if (Button != null)
      {
          Button.Click -= new EventHandler(button_Click); 
      } 
}

还有一种写法

Paste_Image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容