ToolTipsFactory

Object Model - Additional Methods and Functions - GetMultiLineToolTip

Returns the MultiLineTTDatasource-object provided as extended property to a specific control.

[Visual Basic]
<ExtenderProvidedProperty()> _ 
Public Function GetMultiLineToolTip(ByVal acontrol As Control) As MultiLineTTDataSource
[C#]
[ExtenderProvidedProperty()] 
public MultiLineTTDataSource GetMultiLineToolTip(
	Control acontrol
);

Parameters

acontrol

The control, for which to retrieve the provided MultiLineTTDatasource-object.

Description

This function is used to get access to the MultiLineTTDatasource-object of a specific control (acontrol) on the same form as the tooltip-component. An instance of this object is provided to each control on the same form by the MultiLineToolTip-component (ToolTipsFactoryMultiLine). It is this object which holds the tooltip-content (and some other properties) used for the tooltip to be displayed for the specific control.

In the Visual Studio property-grid the access to the MultiLineTTDatasource-object of a specific control is seamlessly integrated in the property-list of the specific control. (See the chapter on "Provided Properties" for more information.)

To get access to the MultiLineTTDatasource-object of a specific control through code, things are not exactly as one would expect: The MultiLineTTDatasource-object is a property provided to a control by the tooltip component, and - if looking at the property-grid of the control - it definitely seems to be just a normal property of that control, but if you try to access this property by code as any other property of the control, you'll see that this is not possible, because the control does not expose such a property. Actually, the control, to which the tooltip-component provides this property, has absolutely no knowledge about this provided property, because this extended properties are managed by the providing component (in this case the MultiLineToolTip-component). Therefore the programmatic access to this properties has to happen through the providing component.  And that's where GetMultiLineToolTip() comes into play. GetMultiLineToolTip() requests and returns a reference to the MultiLineTTDatasource-object provided to the control (acontrol) specified in the function-call.

The following example shows how this looks in code:

 

Dim myToolTipDS As MultiLineTTDataSource

 

'Get a reference to the MultiLineTTDataSource-object

'of lblSalesTotal

myToolTipDS = Me.ImageTT.GetMultiLineToolTip(Me.lblSalesTotal)

 

'Through this reference we get now full access to all

'properties of this object. In this example we

'use this to assign new content (a dynamically

'computed text) for the tooltip displayed

'by lblSalesTotal...

myToolTipDS.Text = GetTotalSalesByRegion()