S
SAL
Hello,
I'm developing this remoting app (.net 2.0) and I need to bring the server
app's form to the front often. Since you can not do cross-thread
communication on a form or control without using Invoke, I declared a
delegate to handle the cross-thread call to bring the form forward. Here's
my code:
Delegate Sub BringMeFront()
Public myDelBringFormFront As BringMeFront
In the constructor I set this delegate =
myDelBringFormFront = New BringMeFront(AddressOf BringFormToFront)
BringFormToFront just does a Me.BringToFront but calling it via the delegate
and Invoke should marshal the call on the calling thread.
So, in the function I'm calling from the client I do this:
If Me.InvokeRequired Then
Me.Invoke(myDelBringFormFront)
Else
Me.BringToFront()
End If
The code hits the Me.Invoke(myDelBringFormFront) code but it doesn't
actually call the BringFormToFront code that I pass in when I new the
myDelBringFormFront method. Can anyone tell me why it's not calling the
function?
Any help???
thanks
S
I'm developing this remoting app (.net 2.0) and I need to bring the server
app's form to the front often. Since you can not do cross-thread
communication on a form or control without using Invoke, I declared a
delegate to handle the cross-thread call to bring the form forward. Here's
my code:
Delegate Sub BringMeFront()
Public myDelBringFormFront As BringMeFront
In the constructor I set this delegate =
myDelBringFormFront = New BringMeFront(AddressOf BringFormToFront)
BringFormToFront just does a Me.BringToFront but calling it via the delegate
and Invoke should marshal the call on the calling thread.
So, in the function I'm calling from the client I do this:
If Me.InvokeRequired Then
Me.Invoke(myDelBringFormFront)
Else
Me.BringToFront()
End If
The code hits the Me.Invoke(myDelBringFormFront) code but it doesn't
actually call the BringFormToFront code that I pass in when I new the
myDelBringFormFront method. Can anyone tell me why it's not calling the
function?
Any help???
thanks
S