You just need to use Delegate and the controls "Invoke" method. This will
ensure that the control method is executed on the controls thread, not the
thread making the call. Like this:
Here is a delegate, representing a method on my main form (doesn't matter
what it is, could be anything really) - this delegate is defined in my
thread.
Private Delegate Sub _onBeginNodeOperations_Delegate(ByVal nAdding As
Integer, ByVal OperationType _
As OperationsThreadState.NodeOperations, ByVal bIsUndoRedo As
Boolean)
Now, the thread wants to execute the delegate method on the main form
thread, not the current thread, so:
Try
m_Form.Invoke(New _onBeginNodeOperations_Delegate(AddressOf
m_Form.BeginNodeOperations), Parameters)
Catch ex As Exception
End Try
"scorpion53061" <sc************@yahoo.com> wrote in message
news:u2**************@TK2MSFTNGP10.phx.gbl...
Hi Fergus,
Can you point me to a tutorial that will allow me to share controls among
threads? I am able to do datasets and such as long as I dont use them in
the primary thread but I would like to learn how to use controls otherwise if
I can.
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl... Hi Robin,
Praise be that you've solved it!!. My heart's been pounding and my
face has been flushed and my mind's been all of a dither. I can calm down
now!! Aaaaahh. ;-))
Regards,
Fergus