Brian
Sun Jul 13 09:16:28 CDT 2003
Because in C# you add the event handlers manually...
mycontrol.someEvent += new EventHandler( this.myEventHandler )
in VB.net... oh, wait I just looked it up, there's actually 2 ways in VB.
If you were connecting your events using Handles you'd have to type them
manually but you can do the same as C# by using AddHandler
(I learnt something new today and it's only 10:00 on a Sunday).
I'm not sure how things will work if Handles is used for the normal event
and AddHandler for the reset timer event, but it's easy enough to test.
There goes one of the reasons I prefer C#. I think I'll just pretend it
never happened.
Brian.
"Herfried K. Wagner" <aon.912666908.N.O.S.P.@.M.aon.at> wrote in message
news:OOIKOPTSDHA.2092@TK2MSFTNGP10.phx.gbl...
> Hello,
>
> "Brian" <acecool@rogers_removethis_.com> schrieb:
> > How about...
> >
> > create another event handler:
> >
> > private void anyButton_Click( object sender, System.EventArgs e )
> > {
> > tmrStartScreenSaver.Enabled = false;
> > tmrStartScreenSaver.Enabled = true;
> > }
> >
> > To save typing connecting up your events:
> >
> > public Form1()
> > {
> > InitializeComponents();
> >
> > foreach( Control control in this.Controls )
> > if( control is Button )
> > control.Click += new EventHandler( this.anyButton_Click );
> > }
> >
> > If this makes sense, you're probably using C#. If yur using
> > VB.NET it will be more of a problem.
>
> Why?
>
> Regards,
> Herfried K. Wagner
> --
> MVP · VB Classic, VB .NET
>
http://www.mvps.org/dotnet
>
>