Version

Save and Restore a Layout

You can set up the interface of an WinExplorerBar™ control either at design-time through the property sheet or UltraExplorerBar Designer, or you can do it at run-time by setting various properties through code. When your application runs, the user can further customize the interface by adding Groups, re-arranging Groups, dragging Items from one Group to another, and so on.

At any point, you can save the current layout of the UltraWinExplorerBar element to a file, which can be re-loaded in the future to restore the element’s layout. At run-time, you also have the option of persisting the element’s layout to (and restoring it from) a storage stream. The layouts persisted by the element include all of the property values maintained by the various Settings objects in the element, which encapsulate all of the Appearances used in the element. This includes the objects returned by the GroupSettings and ItemSettings properties of the element, the Settings and ItemSettings properties of the Group , and the Settings property of the Item . The Groups collection of the element (and all of the Item objects encapsulated by the Groups within it) are also persisted.

To save a layout at design-time

  1. Select the UltraWinExplorerBar control.

  2. Invoke the context menu for the control and select "Save Layout…​"

or

Click on the "Save Layout…​" link in the bottom pane of the .NET property sheet.

The Save Layout dialog will appear.

explains how to save and load ultraexplorerbar's layout
  1. Select the format that will be used for the layout file. Files can be saved in binary or XML format. The binary file format is more compact but it is also proprietary, XML offers a universal format but with generally larger file sizes.

  2. Click the ellipsis (…​) button to enter a file name and select a location for the layout file. Available filename extensions are determined by the type of file you selected in the Save Layout dialog. When you have entered the filename, click Save. A file of the type you specified containing the layout information will be created.

To restore a saved layout at design-time

  1. Select the UltraWinExplorerBar element.

  2. Invoke the context menu for the element and select "Load Layout…​"

or

Click on the "Load Layout…​" link in the bottom pane of the .NET property sheet.

The Load Layout dialog will appear.

  1. Select the format of the layout file you want to load. Layout files can be in binary or XML format.

  2. Click the ellipsis (…​) button to enter a file name and select a location for the layout file. Available filename extensions are determined by the type of file you selected in the Save Layout dialog. When you have entered the filename, click Save. A file of the type you specified containing the layout information will be created.

To save a layout at run-time

In Visual Basic:

Private Sub btnSave_Click(ByVal sender As Object, _
  ByVal e As System.EventArgs) Handles btnSave.Click
	Me.UltraExplorerBar1.SaveAsXml("ExplorerBarLayoutFile.xml")
End Sub

In C#:

private void btnSave_Click(object sender, EventArgs e)
{
	this.ultraExplorerBar1.SaveAsXml("ExplorerBarLayoutFile.xml");
}

To load a layout at run-time

In Visual Basic:

Private Sub btnLoad_Click(ByVal sender As Object, _
  ByVal e As System.EventArgs) Handles btnLoad.Click
	Me.UltraExplorerBar2.LoadFromXml("ExplorerBarLayoutFile.xml")
End Sub

In C#:

private void btnLoad_Click(object sender, EventArgs e)
{
	this.ultraExplorerBar2.LoadFromXml("ExplorerBarLayoutFile.xml");
}