Hi, I'm having an issue handling events when I use ShowDialog() on my
WinForm. I have a COM-visible class. This COMWrapper exposes a public
method that launches a WinForm. I want my end-users to have functionality
like Tab when they navigate this .NET WinForm from the COM client. To enable
this, I have to use Form.ShowDialog().
In the WinForm, I have a public event and I raise this event when a button
on the form is clicked. The COMWrapper class instantiates a module-scope
instance of the WinForm class using the WithEvents keyword. COMWrapper also
exposes a public event. In COMWrapper's event handler for the WinForm event,
I raise the COMWrapper's local event. In this way, I expect to notify the
COM client when an event is raised on the WinForm even though there is no
direct instance of the WinForm in COM.
My expected behavior works if I call the WinForm using Show(). However,
ShowDialog() blocks this message. Since I need the TAB behavior as described
above, how can I get the 'best of both worlds'? Thanks in advance.