Address of 使用请教
Public Sub CountSheep()Dim i As Integer = 1 ' Sheep do not count from 0.
Do While (True) ' Endless loop.
Console.WriteLine("Sheep " & i & " Baah")
i = i + 1
System.Threading.Thread.Sleep(1000) 'Wait 1 second.
Loop
End Sub
Sub UseThread()
Dim t As New System.Threading.Thread(AddressOf CountSheep)
t.Start()
End Sub
请问此处怎么将CountSheep这个方法的过程直接放到AddressOf 后面
因为在C#中 有这段例子
private void Log(LogMsgType msgtype, string msg)
{
rtfTerminal.Invoke(new EventHandler(delegate
{
rtfTerminal.SelectedText = string.Empty;
rtfTerminal.SelectionFont = new Font(rtfTerminal.SelectionFont, FontStyle.Bold);
rtfTerminal.SelectionColor = LogMsgTypeColor[(int)msgtype];
rtfTerminal.AppendText(msg);
rtfTerminal.ScrollToCaret();
}));
}
不知在如何写。