윈도우 프로그래밍/C#
C# WIndowsForm 크로스쓰레드 해결법(Invoke)
하루나비꿀
2018. 6. 20. 13:07
if (this.InvokeRequired) { this.Invoke(new MethodInvoker(delegate() { label14.Text = string.Format("총금액 : " + info.allmoney); })); this.Invoke(new MethodInvoker(delegate() { label15.Text = string.Format("배팅액 : " + info.Player.batmoney); })); }다른 쓰레드에서 메인쓰레드의 폼의 값변환 등등 Invoke처리를 사용할때 사용하면됩니다. 그대로 복사 붙여넣기하고 label14.Text = string.Format("총금액 : " + info.allmoney); 이것만 수정하면 OK!