c# - Detect adding control to form -
hi write component , need when 1 control add form detect event , add control component list , possible ? (design time)
excuse me poor english tnx
do mean system.windows.forms.control.controladded event?
edit: event raised in designtime either.
i created form2
class:
public partial class form2 : form { public form2() { initializecomponent(); this.controladded += new controleventhandler(form2_controladded); } void form2_controladded(object sender, controleventargs e) { this.text += " " + e.control.name; } }
and created form3
class derived form2
class.
public partial class form3 : form2 { public form3() { initializecomponent(); } }
after recompiled solution, opened designer of form3
class, added new button
toolbox , text
property of form changed "form3" "form3 button1".
Comments
Post a Comment