I have the following code in C# that I have trouble converting to VB(2.0):
private delegate void openDialog();
private void openWindowsDial og(openDialog open)
{
Thread thread = new Thread(new ThreadStart(ope n));
thread.SetApart mentState(Apart mentState.STA);
thread.Start();
}
I tried the following code, but it would not compile:
Private Delegate Sub openDialog()
Private Sub openWindowsDial og(ByVal open As openDialog)
Dim thread As Thread = New Thread(New ThreadStart(ope n)) ' exception
here: Error 2 'System.Threadi ng.ThreadStart' is a delegate type and requires
a single 'addressof' expression as the only argument to the constructor.
thread.SetApart mentState(Apart mentState.STA)
thread.Start()
End Sub
Thanks in advance for any help.
private delegate void openDialog();
private void openWindowsDial og(openDialog open)
{
Thread thread = new Thread(new ThreadStart(ope n));
thread.SetApart mentState(Apart mentState.STA);
thread.Start();
}
I tried the following code, but it would not compile:
Private Delegate Sub openDialog()
Private Sub openWindowsDial og(ByVal open As openDialog)
Dim thread As Thread = New Thread(New ThreadStart(ope n)) ' exception
here: Error 2 'System.Threadi ng.ThreadStart' is a delegate type and requires
a single 'addressof' expression as the only argument to the constructor.
thread.SetApart mentState(Apart mentState.STA)
thread.Start()
End Sub
Thanks in advance for any help.
Comment