c# - Cross-thread operation -


i’m doing stuffs in thread , i’m try access label property, can’t set property value.

lbldisplay.visible = true; 

i’m getting error on this. error - cross-thread operation not valid: control 'lbldisplay' accessed thread other thread created on. in advance.

you can’t directly access thread other thread created on. can set property value using methodinvoker.

lbldisplay.invoke((methodinvoker)(() => { lbldisplay.visible = true; })); 

this way need access control in different thread.


Popular posts from this blog