提供一种思路
///控件popup中重写
private void GWYS_Popup(object sender, EventArgs e)
{
//得到当前SearchLookUpEdit弹出窗体
PopupSearchLookUpEditForm form = (sender as IPopupControl).PopupWindow as PopupSearchLookUpEditForm;
SearchEditLookUpPopup popup = form.Controls.OfType<SearchEditLookUpPopup>().FirstOrDefault();
LayoutControl layout = popup.Controls.OfType<LayoutControl>().FirstOrDefault();
//如果窗体内空间没有确认按钮,则自定义确认simplebutton,取消simplebutton,选中结果label
if (layout.Controls.OfType<Control>().Where(ct => ct.Name == "btOK").FirstOrDefault() == null)
{
//得到空的空间
EmptySpaceItem a = layout.Items.Where(it => it.TypeName == "EmptySpaceItem").FirstOrDefault() as EmptySpaceItem;
//得到取消按钮,重写点击事件
Control clearBtn = layout.Controls.OfType<Control>().Where(ct => ct.Name == "btClear").FirstOrDefault();
clearBtn.Text = "清除";
//得到查询按钮
Control findBtn = layout.Controls.OfType<Control>().Where(ct => ct.Name == "btFind").FirstOrDefault();
findBtn.Text = "查询";
LayoutControlItem clearLCI = (LayoutControlItem)layout.GetItemByControl(clearBtn);
clearBtn.Click += clearBtn_Click;
}
本文介绍了一种在控件SearchLookUpEdit的弹出窗口中自定义按钮的方法,包括如何添加确认和取消按钮,并重写点击事件,适用于需要定制化用户交互的场景。

3709

被折叠的 条评论
为什么被折叠?



