The following piece of code shows an Insert table dialog:
Dialog d = WordApp.Dialogs[WdWordDialog.wdDialogTableInsertTable]; int result = d.Show(ref missing); if (result == -1) // if user pressed OK { d.Execute(); }
The problem is that the dialog does not respond to mouse clicks. It responds to keyboard input, though.
Moreover, if I press Alt+Tab (to switch to some other running app) and then press Alt+Tab again (to switch back to my app), it responds to both mouse and keyboard input.
My guess is that my application doesn’t ‘know’ that a dialog box was shown (because it doesn’t happen in a regular Form.ShownDialog way) and it keeps the focus.
How can I solve this problem?
I worked it out.
I’m not exactly sure why but this helps: before displaying the dialog I disable the main application form, then after the dialog is displayed I enable it back.