Link to home
Create AccountLog in
Avatar of ConvertCtoVB
ConvertCtoVB

asked on

Converting C# to VB

Hi,

can you help me to convert this C# code to VB.net code:
private static void DoEvents()
        {
            DispatcherFrame frame = new DispatcherFrame(true);
            Dispatcher.CurrentDispatcher.BeginInvoke(
            DispatcherPriority.Background, (SendOrPostCallback)delegate(object arg)
            {
                var f = arg as DispatcherFrame;
                f.Continue = false;
            },
            frame
            );
            Dispatcher.PushFrame(frame);
        } 

Open in new window


I tried to use http://converter.telerik.com/ but this result has errors :
Private Shared Sub DoEvents()
	Dim frame As New DispatcherFrame(True)
	Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, DirectCast(Function(arg As Object) Do
		Dim f = TryCast(arg, DispatcherFrame)
		f.[Continue] = False
	End Function, SendOrPostCallback), frame)
	Dispatcher.PushFrame(frame)
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Wim_Bl
Wim_Bl
Flag of Belgium image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ConvertCtoVB
ConvertCtoVB

ASKER

Great work! Thank you for solution.