Grasshopper

algorithmic modeling for Rhino

Custom Windows forms _ Stays up when Rhino doc minimized/maximized !

Hi, 

this question is related to another discussion about windows forms.

when rhino window is minimized or maximized the GH document also minimized and maximized, other words listens to (Rhino) parent window. If I am not wrong, GH document Editor is either a child window of the Rhino doc or gh doc is owned by rhino window !

I have a custom gh component that implements a windows form. The form is minimized/maximized when GH document editor is minimized.maximized but it stays up when Rhino document is minimized/maximized. 

Is there any way that the form of GH component can also listens the Rhino window states ? 

I have tested a few things, but didn't seem to work ! Try to set Mdi (multiple document interface) 

m_form.MdiParent = Grasshopper.Instances.DocumentEditor.ParentForm;

m_form.Show(Grasshopper.Instances.DocumentEditor); // this sets form's owner !

Thank you, 

Views: 1100

Replies to This Discussion

You should use m_form.Show(Grasshopper.Instances.DocumentEditor);   that is the correct way. MDI is not relevant here. Additionally, you can register your form with the FormShepard on the main Grasshopper window, it will take care of moving and minimizing:

Grasshopper.Instances.DocumentEditor.FormShepard.RegisterForm(m_form);

--

David Rutten

david@mcneel.com

Thank you David! works like a charm!

Btw, I love the definition of the 'FormShepard' method :

David,

Is there a plan to support WPF based Shepard? I am currently using Andrew Heuman's implementation for managing window ownership, but it would be nice to have GH handle that.

Cheers! 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service