ToolTipsFactory |
![]()
This method applies a background-layout stored in a TTBackgroundOverride-object to the tooltip-component.
[Visual Basic] Public Sub ApplyBackgroundOverrides( _ ByVal backgroundOverride As TTBackgroundOverride )
[C#] public void ApplyBackgroundOverrides( TTBackgroundOverride backgroundOverride );
Parameters
backgroundOverride
A TTBackgroundOverride-object which contains a tooltip background-layout.
Description
This method applies a background-layout stored in a TTBackgroundOverride-object to the tooltip-component in order to override the default values defined for the component. Usually this method is used internally by the ApplyOverrides()-method of the different components. Only ApplyOverrides() makes sure that the component saves the complete current layout before the override-values are applied. The saved layout can later be restored with a call to RestoreOriginalLayout(). This ApplyOverrides()-RestoreOriginalLayout()-cycle happens automatically for the override-values defined through the Override-property of a control (see Provided Properties).
ApplyBackgroundOverrides() does not make such a copy of the layout-values it is going to change! If ApplyBackgroundOverrides() is going to be used directly to apply a new background-layout, the application developer is responsible to make sure that the original (or default) values can be restored.
Actually, the only scenario, where the direct use of ApplyBackgroundOverrides() could be useful, is if the override-values specified for a control should also dynamically be overridden. (E.G. the tooltip-background for a specific control should look different every time the tooltip does pop-up.)
Example
The following code creates a TTBackgroundOverride-object, sets the values for the layout-properties to be overridden and applies this TTBackgroundOverride-object to the component.
'Declare and create an instance of TTBackgroundOverride...
Dim myBackground As ToolTipsFactory.Shared.TTBackgroundOverride
myBackground = New ToolTipsFactory.Shared.TTBackgroundOverride
'Assign values to the properties to be overridden..
myBackground.BackgroundStyle = BackgroundStyleOverride.Normal
myBackground.BorderColor = Color.Indigo
'Apply the new background-layout to the component...
Me.MultiLine.ApplyBackgroundOverrides(myBackground)
After the execution of this code, the next time a tooltip provided to a control by MultiLine will be displayed, it will appear with the applied background. If the original background-layout has not been saved somehow, the applied background will become the default background-layout for the tooltips of all controls on the same form.