public ExSearchEdit()
{
InitializeComponent();
this.Properties.NullText = "---請選擇---";
this.Properties.PopupFormSize = new Size(300, 350);
this.Properties.ShowClearButton = false;
}
///類似於重寫Find
private void ExSearchLookEdit_Popup(object sender, EventArgs e)
{
隱藏Find
//LayoutControl lc = (sender as IPopupControl).PopupWindow.Controls[2].Controls[0] as LayoutControl;
//((lc.Items[0] as LayoutControlGroup).Items[1] as LayoutControlGroup).Items[1].Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
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;
Button.Text = "新增";
if (Button != null)
{
Button.Click -= new EventHandler(button_Click);
Button.Click += new EventHandler(button_Click);
}
}
private void ExSearchLookEdit_QueryCloseUp(object sender, 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;
Button.Text = "新增";
if (Button != null)
{
Button.Click -= new EventHandler(button_Click);
}
}
private void button_Click(object sender, EventArgs e)
{
ExSearchEdit_Add editor = new ExSearchEdit_Add();
editor.ShowDialog();
}