Handle một lỗi Thread chạy trước khi Control được tạo dẫn đến lỗi
This commit is contained in:
parent
30f5f14ee7
commit
5d7dcd63da
|
@ -22,6 +22,8 @@ namespace AIParkingApplication
|
|||
private void UpdateStatus()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (IsHandleCreated)
|
||||
{
|
||||
lblDateTime.Invoke(new Action(() =>
|
||||
{
|
||||
|
@ -43,6 +45,7 @@ namespace AIParkingApplication
|
|||
lblPingTimeServer.BackColor = pingResult.BackColor;
|
||||
lblPingTimeServer.ForeColor = pingResult.ForceColor;
|
||||
}));
|
||||
}
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user