๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/C#

C# - ์Šค๋ ˆ๋“œ์—์„œ ์œ„์ ฏ ์กฐ์ž‘ํ•˜๊ธฐ

by Janger 2022. 8. 23.
728x90
๋ฐ˜์‘ํ˜•

 

private void AggiornaContatore()
 {         
     if(this.lblCounter.InvokeRequired)
     {
         this.lblCounter.BeginInvoke((MethodInvoker) delegate() {this.lblCounter.Text = this.index.ToString(); ;});    
     }
     else
     {
         this.lblCounter.Text = this.index.ToString(); ;
     }
 }

Invoker ์‚ฌ์šฉ

์ถœ์ฒ˜:
https://stackoverflow.com/questions/14890295/update-label-from-another-thread

 

Update label from another thread

I use a thread writing in another class for update a label. The label is contents in Winform Main class. Scanner scanner = new Scanner(ref lblCont); scanner.ListaFile = this.listFiles; Thread t...

stackoverflow.com

 

728x90
๋ฐ˜์‘ํ˜•