namespace Yw.WinFrmUI { /// /// /// public partial class GeneralSearchAndExportCtrl : DevExpress.XtraEditors.XtraUserControl { /// /// /// public GeneralSearchAndExportCtrl() { InitializeComponent(); this.layoutControl1.SetupLayoutControl(); } /// /// 搜索 /// public event Action SearchEvent; /// /// 清空 /// public event Action ClearEvent; /// /// 导出 /// public event Action ExportEvent; //搜索 清空 private void buttonEditSearch_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { var tag_obj = e.Button.Tag; if (tag_obj is string tag) { SetClickEvent(tag); } } //设置 private void buttonEditSet_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { var tag_obj = e.Button.Tag; if (tag_obj is string tag) { SetClickEvent(tag); } } //点击 private void SetClickEvent(string tag) { switch (tag) { case "Search": { this.SearchEvent?.Invoke(); } break; case "Clear": { this.ClearEvent?.Invoke(); } break; case "Export": { this.ExportEvent?.Invoke(); } break; default: break; } } } }