Probably not correctly
I can tell you that the MethodInvoker delegate is in the System.Windows.Forms namespace, and that the TimerCallback delegate is in
the System.Threading namespace.
I'm not sure how you would invoke them using VB.NET, but I imagine it must be similar.
I'm pretty sure that VB.NET doesn't have a "using" block as the one I've used here:
using (System.Threading.Timer timer = new System.Threading.Timer(
new TimerCallback(HideForm), form, timeout, Timeout.Infinite))
{
while (complete == 0)
Application.DoEvents();
System.Threading.Interlocked.Exchange(ref complete, 0);
}
so, instead... just do this (in VB, of course):
Dim timer As System.Threading.Timer
Try
timer = new System.Threading.Timer(new TimerCallback(HideForm), form, timeout, Timeout.Infinite))
while (complete = 0)
Application.DoEvents()
end while ??
System.Threading.Interlocked.Exchange(ByRef complete, 0)
Finally ??
timer.Dispose()
End Try ??
The rest of the conversions are probably intuitive, i.e. delete ";"'s at the end of each line, change the way you dimension
variables, replace { } blocks with "name"..."End name", etc.