Patrick,
It seems like the ToolStripManager.Merge does not work? I think I have a working solution by manually merging the ToolStrips. Here is what I did:
1. In the form, override the CreateNavToolBar method:
protected override void CreateNavToolBar()
{
base.CreateNavToolBar();
// manual merge
for (int i = 0, i < MyTools.Items.Count; i++)
{
this.NavToolBar.Items.Add(MyTools.Items[i]);
}
}
2. In MyTools which is a subclass of mmToolStrip, I use the designer to add buttons to the items collection property. For instance, you can add framework buttons (ButtonNew, ButtonDelete, etc.) or your own custom buttons.
3. In the click event of the button, you can get a reference to the active form and call the appropriate method:
private void ButtonSearch_Click(object sender, EventArgs e)
{
// get a reference to the active form
Form ActiveFormObj = mmAppDesktop.MainForm.GetActiveForm();
mmBusinessForm BusinessForm = ActiveFormObj as mmBusinessForm;
if (BusinessForm != null)
{
// call a form method
BusinessForm.Search();
}
}
It took me a while to get here, but this works well.
Kevin,
Maybe this could be handled with a Factory method instead overriding CreateNavToolBar on each form?
Kind Regards,
Mat