C# Invoke 사용하기

C# : 2009. 8. 14. 13:59

쓰레드 사용시 값을 입력하거나 변경하려 하면 크로스쓰레드가 발생합니다.
아래처럼 Invoke를 사용하면 됩니다..

public delegate void EventHandler_th(string str);
...
EventHandler_th eventhandler = new EventHandler_th(textBox1.AppenText);
this.Invoke(eventhandler, tmp+"\r\n");

'C#' 카테고리의 다른 글

C# 쓰레드사용시 Invoke로 MdiParent 사용법  (0) 2009.08.14
Posted by 아르다