Hi guys, I know this is probably a common one, its also quite tricky to know how to get around it (I find anyway).
I have a seperate thread, within that thread I have defined an object (of my own class).
Obj.UpdateMyForm is called, but how do I get the code from my class to update the form?
Normally, I would use a sub routine with the following
I found this code online a while back, and it seems to work if I call the sub routine directly from another thread, however, calling it from one of my class sub routines doesn't seem to work.
Has anybody any suggestions? If i'm honest, this invoke code confuses me a little, i'm not 100% on whats actually going on behind the scenes
I have a seperate thread, within that thread I have defined an object (of my own class).
Obj.UpdateMyForm is called, but how do I get the code from my class to update the form?
Normally, I would use a sub routine with the following
VB.NET:
Sub Update()
if me.InvokeRequired = true then
me.invoke(new methodinvoker(addressof update))
else
label1.text ="test"
end if
I found this code online a while back, and it seems to work if I call the sub routine directly from another thread, however, calling it from one of my class sub routines doesn't seem to work.
Has anybody any suggestions? If i'm honest, this invoke code confuses me a little, i'm not 100% on whats actually going on behind the scenes