Use invoke so that we run code on the UI thread (no idea how this was working before)
This commit is contained in:
Родитель
77e7a20f83
Коммит
da843919c9
|
@ -103,7 +103,12 @@ namespace WindowsFormsSample
|
||||||
|
|
||||||
private void Log(Color color, string message)
|
private void Log(Color color, string message)
|
||||||
{
|
{
|
||||||
messagesList.Items.Add(new LogMessage(color, message));
|
Action callback = () =>
|
||||||
|
{
|
||||||
|
messagesList.Items.Add(new LogMessage(color, message));
|
||||||
|
};
|
||||||
|
|
||||||
|
Invoke(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class LogMessage
|
private class LogMessage
|
||||||
|
|
Загрузка…
Ссылка в новой задаче