I am trying to add a drop down to my component’s drop down so I can organise and arrange the inputs so things are easy to find. I can get it to compile, but I just can’t get it to show me the form. Any tips?
System.Windows.Forms.Control control = new System.Windows.Forms.Control();
System.Windows.Forms.ToolStripDropDown timber = new System.Windows.Forms.ToolStripDropDown();
Grasshopper.Kernel.GH_DocumentObject.Menu_AppendCustomItem(timber, control);
timber.Items.Add("one");
timber.Items.Add("two");
timber.Items.Add("three");
Hello, assuming you are developing a component with Visual Studio, there should be an overridable function like this.
public override void AppendAdditionalMenuItems(System.Windows.Forms.ToolStripDropDown menu)
{
base.AppendAdditionalMenuItems(menu);
Menu_AppendCustomItem(menu, myControlPanel);
Menu_AppendSeparator(menu);
}
Hello, seems like “timber” is what you created. You need to attache your controls to the menu provided by your component instead of the one you created. The menu you created will be disposed in a millisecond. I think “timber” should be replaced by a System.Windows.Forms.ToolStripDropDown that comes down as an input of AppendAdditionalMenuItmes. ( which is System.Windows.Forms.ToolStripDropDown menu in my code)