How can I create a Settings dialog for a Word Addin.
I have already creating a Windows Form
and I'm calling 'form.Show()`. But It's creating a new Window.
How can I pass the owner by form.ShowDialog(owner)
?
I've solve my question creating a Helper for open the Dialog, but I don't know if is the best way
public static DialogResult ShowDialog(Form dialog)
{
NativeWindow mainWindow = new NativeWindow();
mainWindow.AssignHandle(Process.GetCurrentProcess().MainWindowHandle);
DialogResult dialogResult = dialog.ShowDialog(mainWindow);
mainWindow.ReleaseHandle();
return dialogResult;
}