Close Events

i’m developing a plug-in with Rhino 7 and VB. All seems to be fine but when i try to minimize Rhino, the plug-in receive a Close event and it stops. Is this the normal behaviour? If yes, how can i avoid it? My plug-in needs to stay up forever!


Hi @stefanik,

What does this mean? A RhinoApp.Closing event?

More details and perhaps sample code is required.


– Dale

thx for your reply. I have a plugin written in VBNET with Rhino 7 that has a MainForm (WinForm). The main form is shown this way from command class:

I know this method is deprecated but i’ve found nothing else to display the form with the exception of ShowModal that prevent me to interact with Rhino (and this is not good for my application).

The plugIn works as expected but if i try to minimize Rhino, the MainForm seems to receive a close event like the one that occur if i close the window. I mean, if i place a break point here, inside the mainform:

and try to minimize Rhino, the breakpoint occur. Even the cancel = true doesn’t have any effect. If then i maximize Rhino, the plugin mainform is not present!

After some search i found this example:

I’ve implemented it and this way it seems ok. Now the behavior abobe doesn’t happen anymore (blame ShowSemiModal?).
At this point i have three questions:

  1. is the previous behavior expected? I mean, the plugin form has to close at Rhino minimize event with ShowSemiModal?
  2. the link above is the correct way to show plugins forms?
  3. Which alternatives to ShowSemiModal?


Have you tried checking the state of the Rhino Main Window and if it is minimized, then just minimize your form and cancel the close event?

what do you mean with “cancel the close event”? In my mainform.FormClosing, as you can see in my previos post, i already have e.Cancel = true but it does nothing; the mainform close.

You mean, catch Rhino minimize event and minimize the plugin so Rhino probably don’t close it?

Anyway, is this behaviour only happening to me? No one of you observed this? Could you try?
I have another colleague working to another plugin and he observed the same!

Hi @stefanik,

I’ve confirmed the behavior, with Eto dialogs display in semi-modal form, you’ve reported. I haven’t’ had time to dig into what’s going on.

– Dale