vb.net - Default Handler created in designer -


if create usercontrol , drag form, double click on it, create sub:

 private sub myusercontrol_load(sender object, e eventargs) handles myusercontrol.load   end sub 

is possible change default handler? example produce on click handler:

 private sub myusercontrol_click(sender object, e eventargs) handles myusercontrol.click   end sub 

you'd have create own class this... little waste of time really, since you'd have add code inherit custom class every time create new usercontrol.

but if you're interested in testing it:

<defaultevent("click")> _ public class myusercontrol     inherits usercontrol end class 

then put in every usercontrol create (below public class line):

inherits myusercontrol 

note error on inherits myusercontrol line. if so, apply fix says "change [class name] inherit myusercontrol."

hope helps!


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -