ToolTipsFactory

Object Model - Common Methods and Functions - LoadLayout

This method loads a tooltip-layout from file.

[Visual Basic]
Public Sub LoadLayout(ByVal layoutFile As String)
[C#]
public void LoadLayout(string layoutFile);

Parameters

layoutFile

A string that contains the name of the file from which to load the tooltip-layout.

Description

This method loads a tooltip-layout from file and makes the loaded layout the default layout for the component and therefore for the tooltips of all controls on the same form as the component.

Tooltip layout-files are files previously saved either by a call to SaveLayout() inside of an application that uses ToolTipsFactory tooltips or through one of the "ToolTips layout designers". By default, the designer of each of the tooltip components saves the files with it's own extension, but LoadLayout() does not enforce the files to be loaded for a component to have the expected matching extension. 

Tooltip layouts are saved as XML-files, where each property is stored as a key/value-pair. This makes it possible to "share" layouts between different kinds of tooltips. Because the tooltip components have many properties in common (same name, same type), LoadLayout() will load all matching properties and ignore the others.  

LoadLayout() will throw exceptions, when one of the typical situations arises when accessing files (FileNotFoundException, ArgumentException etc.). In addition it might throw other exceptions if the loaded file contains invalid data (i.e. it is not a valid ToolTipsFactory tooltip layout-file.) It is up to the application developer to catch and - optionally - handle this exceptions appropriately.

Example

The following code loads a tooltip-layout from file: 

'Load the deep-blue layout from the layout repository...

Me.MultiLine.LoadLayout("C:\Layouts\DeepBlue.mtt")

After the execution of this code, the next time a tooltip based on MultiLine will be displayed, it will appear with the "DeepBlue"-layout, as long as there are no layout-overrides defined for the specific control, for which the tooltip appears.