Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ToolStripManager.Merge with NavToolBar
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01123541
Message ID:
01123687
Vues:
39
Matthew,
It looks like you have to copy and override mmMainAppForm.CreateNavToolBar() into MainForm.cs and/or each of your business forms (or create your own subclasses).

MainForm.cs:
/// <summary>
/// Creates the Navigation toolbar
/// </summary>
public override void CreateNavToolBar()
{
 // Set main form to "Last instantiated" form. This is necessary so the
 // toolbar gets registered with the correct form
 Form form = mmAppDesktop.FormMgr.GetLastInstantiatedForm();
 mmAppDesktop.FormMgr.SetLastInstantiatedForm(this);

 // Instantiate the toolbar
 mmFactoryDesktop FactoryDesktop = (mmFactoryDesktop)mmAppDesktop.Factory;
 #if MM2005
   this.NavToolBar = FactoryDesktop.CreateNavigationToolStrip();
// +++ merge here +++ ///
#else
   this.NavToolBar = FactoryDesktop.CreateNavigationToolBar() ;
#endif
   this.NavToolBar.Dock = this.NavToolBarDock;

 // Reset last instantiated form
 mmAppDesktop.FormMgr.SetLastInstantiatedForm(form);
}
And in forms derived from mmBusinessForm:
/// <summary>
/// Create the navigation toolbar (factory method)
/// </summary>
protected override void CreateNavToolBar()
{
#if MM2005
this.NavToolBar = ((mmFactoryDesktop)mmAppDesktop.Factory).CreateNavigationToolStrip();
// +++ merge here +++ ///
#else
this.NavToolBar = ((mmFactoryDesktop)mmAppDesktop.Factory).CreateNavigationToolBar();
#endif
this.Controls.Add(this.NavToolBar);
}
I'm trying to create a custom toolbar with Save, Cancel, Delete, First, Previous, Next, Last, Search by [DropDown], Search [ComboBox w/History]. But that's down the task list a ways.

If you get this to work, please post your code here.

Dear Kevin McNeish, please update
MM .NET Developer's Guide /
Creating Windows Forms Applications /
Creating Your Own Custom Navigation Toolbar (Walkthrough)
for VS 2005, .NET 2.0

Thanks!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform