Custom user control doesn't catch any mouse events in c# -
i create custom user control , use in form.
but not capture mouse event! problem? thanks
define event in custom control
private delegate void myclickevent(object sender, eventargs e); public event myclickevent myclick; public void onmyclickevent(object sender, eventargs e) { if (myclick != null) myclick(sender, e);//execute event }
now in mainform
public partial class form1 { public form1() { mycustombutton.myclick += firethisonclick; } private void firethisonclick(object sender, eventargs e) { //this executed on click } }
Comments
Post a Comment