Converting code from C# to VB.NET

Converting code from C# to VB.NET

Post by RHVzaHlhbn » Fri, 22 Apr 2005 20:32:04


Hello everyone,
This is the second time I am asking the same question to this newsgroup. Can
somebody tell me how to convert the following code from C# to VB.NET.

myTimer.Tick += new EventHandler(OnTimer);

public static void OnTimer( Object myObject, EventArgs myEventArgs )
{
---
};

Please respond asap

Thanks and regards,
 
 
 

Converting code from C# to VB.NET

Post by Patrice Sc » Fri, 22 Apr 2005 21:50:30

We saw the question ;-) It's best to avoid posting multiple times.

You can use AddHandler :

AddHandler MyObject.MyEvent,AddressOf MySub

You can also use the Handles clause to do that in amore declarative way :

Sub MySub Handles MyObject.MyEvent
' do something
End Sub

--
Patrice

"Dushyant" < XXXX@XXXXX.COM > a rit dans le message de

Can

 
 
 

Converting code from C# to VB.NET

Post by RHVzaHlhbn » Sun, 24 Apr 2005 20:17:06

Thanks Patrice...
And yeah i will avoid posting multiple times..