EearchLookUpEdit使用方法

 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();

        }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章