글
둘다 MSDN에서 구해온 것임을 알립니다.(출처 : www.msdn.com)
먼저
C#용...
WPF용.
먼저
C#용...
private void SetText(string text) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.textBox1.InvokeRequired) { SetTextCallback d = new SetTextCallback(SetText); this.Invoke(d, new object[] { text }); } else { this.textBox1.Text = text; } }
WPF용.
void SetTextdele(string str) { if(this.Dispatcher.Thread != Thread.CurrentThread) { ts = new TextSet(SetTextdele); Dispatcher.Invoke(ts, str); } else { this.label1.Content = str; } }
RECENT COMMENT