ToolTipsFactory |
This function returns a boolean value that indicates if one or more override-values are set for the tooltip-layout of a specific control.
[Visual Basic] Public Function OverridesPresent() As Boolean
[C#] public bool OverridesPresent();
Parameters
none
Return value
A Boolean value. If one or more override-values are set for a given control, this function returns True, otherwise False.
Description
The ToolTipsFactory tooltip components provide a so called extended property to each control on the same form as the tooltip-component (see the section on "Provided Properties"). This provided properties point to complex objects which enclose several content and layout properties for the tooltip-component that provides the extended property. One of this sub-properties is the Override-property, which encapsulates all overridable layout-properties that might be applied to the tooltip-component when the tooltip for a specific control is activated. See "The Override-Property" for a detailed discussion and the "Quick start tutorial - Part III" for an introduction on how to override layout-elements of the tooltip-components for the tooltips of individual controls.
Because the Override-property itself is a complex object and there are quiet a lot of layout-elements that can be overridden, the override-objects provide the function OverridesPresent() to determine if one or more layout-elements are overridden for the tooltip of the specific control.
Example
The following code gets the override-object of a specific control and checks whether there are overridden layout-values to be used when the tooltip for this control is activated. If this is the case, it calls a procedure which saves the override-layout defined for this control into a standard ToolTipsFactory tooltip layout-file (how to do this is described in the section on "RestoreOriginalLayout()").
Private Sub SaveMultiLineTTOverride(ByVal comp As ToolTipsFactoryMultiLine, _
ByVal control As Control, _
ByVal file As String)
'We assign the override-object to a variable
'to make the code more readable...Dim myOverrides As MultiLineTTOverride
myOverrides = comp.GetMultiLineToolTip(control).Override
If myOverrides.OverridesPresent Then
SaveOverrides(comp,myOverrides)
End If
End Sub
Private Overloads Sub SaveOverrides(ByVal comp As ToolTipsFactoryMultiLine, _
ByVal file As String, _
ByVal overrides As MultiLineTTOverride)
'Apply the Override-layout to the component...
comp.ApplyOverrides(overrides)
'Save the (overridden) layout into a file....
comp.SaveLayout(file)'This restores the previously active layout...
comp.RestoreOriginalLayout()End Sub