Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
160 views
Welcome To Ask or Share your Answers For Others

1 Answer


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...