I have this code:
Public Class main
Public Shared classOne As classOne
Public Shared classTwo As classTwo
Public Shared Sub main()
classOne = new classOne()
classTwo = new classTwo()
classTwo.myThread.Start()
Application.Run(classOne)
End Sub
End Class
classOne is a simple winforms with a textlabel. I just would like modify the background color of this textlabel from classTwo but there is a problem because classTwo is in an other thread.
I know I must use a delegate and invoke method but i don't know how to do it. Where should I declare the delegate function and where I have to use invoke method please? I have already ridden the MSDN documentation but I failed to apply it...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…