c# - Winforms user controls custom events -
Is there any way to give user control custom events, and event control user (I'm not sure if the correct word is , Then call)
Sample of Public Partial Class: UserControl {Public Sample} (InitializeComponent ();} Private Zero Text Box (Valid Object Sender, Event Argus E) {// Iajaz User Control Event here}}
and mainframe:
public partial class Mainfrom : Forms {Personal Sample Sample Controller = New Sample (); Public MainForm () {this.InitializeComponent (); SampleUserControl.Click + = New EventHeadler (this.CustomEvent_Handler);} Private Zero CustomEvent_Handler (Object Sender, EventAgds E) {/ In addition to the example posted by Steve, Syntax is also available / Dot Dot}}
class MyUserControl: UserControl The public event EventHandler text box is valid {{textBox1.Validated + = value; } Remove {textBox1.Validated - = value; }}}
Comments
Post a Comment