using System; using System.Windows.Forms; namespace PaintDotNet.CustomControl { public partial class ParametersSettingAdjustControl : BaseUserControl { //定义发布消息的事件 public event EventHandler applyButtonClick; //使用默认的事件处理委托 public event EventHandler sureButtonClick; private void InitializeLanguageText() { if (!DesignMode) { this.applyButton.Text = PdnResources.GetString("Menu.application.text"); this.button2.Text = PdnResources.GetString("Form.OkButton.Text"); this.groupBox2.Text = PdnResources.GetString("Menu.operation.text"); } } /// /// 图像处理的操作Control /// 包括应用、确定 /// public ParametersSettingAdjustControl() { InitializeComponent(); InitializeLanguageText(); } //应用按钮点击事件 private void applyButton_Click(object sender, EventArgs e) { if (applyButtonClick != null) { applyButtonClick(this, new System.EventArgs()); } } //确定按钮点击事件 private void button2_Click(object sender, EventArgs e) { if (sureButtonClick != null) { sureButtonClick(this, new System.EventArgs()); } } } }