Home All Groups Group Topic Archive Search About

how to set a default event on a user control

Author
22 Mar 2006 9:02 PM
Brian Henry
when you have a user control on a form and double click it, it creates code
to handle its default event "Load" how can i change this so if i double
click  a user control on a form that it will take by default the event I
specified as the default one? thanks!

Author
22 Mar 2006 9:47 PM
Herfried K. Wagner [MVP]
"Brian Henry" <nospam@nospam.com> schrieb:
> when you have a user control on a form and double click it, it creates
> code to handle its default event "Load" how can i change this so if i
> double click  a user control on a form that it will take by default the
> event I specified as the default one?

\\\
<DefaultEvent("Tick")> _
Public Class...
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
22 Mar 2006 9:53 PM
Armin Zingler
"Brian Henry" <nospam@nospam.com> schrieb
> when you have a user control on a form and double click it, it
> creates code to handle its default event "Load" how can i change
> this so if i double click  a user control on a form that it will
> take by default the event I specified as the default one? thanks!


<System.ComponentModel.DefaultEventAttribute("MyEvent")> _
Public Class UserControl1

End Class



Armin