Main Window Form

I have a modeless tool window that I want to float on top of the Rhino Main window at all times.

I tried using the form.TopMost property, but realized that this made the dialog sit above EVERY application window even when switching to something other than Rhino.

I have read that the way to do this is to set the Form.Owner property to be the main rhino window, and to this end have tried using the following code:

my_modeless_form.Owner=System.Windows.Forms.Control.FromHandle(rh.RhinoApp.MainWindowHandle())

Unfortunately, this seems to always return None.

I understand that Rhino is built on C++ and not windows forms directly, but is it possible for me to get a .NET Windows Form “version” of the main window?

edit: It seems to work when I do the following:

my_modeless_form.Show(rh.RhinoApp.MainWindow())

See if this sample gets you anywhere.

https://github.com/dalefugier/SampleCsModelessForm