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:
@@ -22,6 +22,8 @@ namespace AIParkingApplication
|
|||||||
private void UpdateStatus()
|
private void UpdateStatus()
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
|
{
|
||||||
|
if (IsHandleCreated)
|
||||||
{
|
{
|
||||||
lblDateTime.Invoke(new Action(() =>
|
lblDateTime.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
@@ -43,6 +45,7 @@ namespace AIParkingApplication
|
|||||||
lblPingTimeServer.BackColor = pingResult.BackColor;
|
lblPingTimeServer.BackColor = pingResult.BackColor;
|
||||||
lblPingTimeServer.ForeColor = pingResult.ForceColor;
|
lblPingTimeServer.ForeColor = pingResult.ForceColor;
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user