I\'m working on an Excel add in that opens a winform after the user clicks a button on a ribbon bar. This button needs to be non-modal so that the user can still interact w
You need to create a class that implements IWin32Window
and returns Excel's Application.Hwnd
property.
For example:
class ArbitraryWindow : IWin32Window {
public ArbitraryWindow(IntPtr handle) { Handle = handle; }
public IntPtr Handle { get; private set; }
}
newForm.Show(new ArbitraryWindow(new IntPtr(Something.Application.Hwnd)));