I believe you want something like this:
public partial class Sample: UserControl { public event EventHandler TextboxValidated; public Sample() { InitializeComponent(); } private void TextBox_Validated(object sender, EventArgs e) {
And then in your form:
public partial class MainForm : Form { private Sample sampleUserControl = new Sample(); public MainForm() { this.InitializeComponent(); sampleUserControl.TextboxValidated += new EventHandler(this.CustomEvent_Handler); } private void CustomEvent_Handler(object sender, EventArgs e) {
Steve Danner Feb 02 2018-10-02T00 : 00Z
source share