D
Duncan Mole
Hi,
I have 2 forms that subscribe to the same event published by the same
instance of an object. In each case the event handler invokes the
invalidation of a member panel using a reference to initial form in the
application - ie definatley the GUI thread.
The problem arises when I launch form B from form A with ShowDialog(). Now
when the event is fired my invoke is called on the first form to subscribe -
A, this call never completes and B's handler is not called by the event
delegate. One can assume that a control cannot be invoked when it is waiting
for ShowDialog to return.
Whilst I think I understand the problem I am suprised at the conclusion I
must draw. In order to remain vsually responsive to a particular event forms
may not be shown modally.
Has anyone else come up against this problem? There must be a work around
there somewhere. Is this what BeginInvoke in the full framework is for?
I have 2 forms that subscribe to the same event published by the same
instance of an object. In each case the event handler invokes the
invalidation of a member panel using a reference to initial form in the
application - ie definatley the GUI thread.
The problem arises when I launch form B from form A with ShowDialog(). Now
when the event is fired my invoke is called on the first form to subscribe -
A, this call never completes and B's handler is not called by the event
delegate. One can assume that a control cannot be invoked when it is waiting
for ShowDialog to return.
Whilst I think I understand the problem I am suprised at the conclusion I
must draw. In order to remain vsually responsive to a particular event forms
may not be shown modally.
Has anyone else come up against this problem? There must be a work around
there somewhere. Is this what BeginInvoke in the full framework is for?