Applies to DotNetBar 5.9 or older. With DotNetBar 6.0 and later use DotNetBarManager.SaveLayout, LoadLayout and LayoutDefinition methods and properties.

If you want to preserve any user made changes to the DotNetBar user interface elements we recommend using DotNetBarManager.LoadDefinition and DotNetBarManager.SaveDefinition methods.

When using DotNetBar designer to create default definition for your menus and toolbars actual definition file gets compiled into your executable. Following is the process that we recommend that you follow so you improve the performance of definition files loading:

  1. In form constructor after call to InitializeComponent you should check whether custom definition file exists and if it does you should set DotNetBarManager.DefinitionName=”” (empty string) – This will disable loading of default DotNetBar definition file.
  2. In form load event, you will check again whether custom definition file exists and if it does you will call DotNetBarManager.LoadDefinition method passing the file name into it to load the custom definition.

In essence this procedure avoids loading of the definition files twice, since if you don’t disable loading of the default definition file, it will be loaded first, then you will load your custom definition file which overwrites it.

Related posts:

  1. Loading definition shows hidden MDI Child
  2. How to Embed definition file in VC++
  3. Working with DotNetBar from code.
  4. GDI+ Exceptions
  5. How to add any control to menu, toolbar and other DotNetBar controls