ToolTipsFactory |
Assigns the passed AnimationTTDatasource-object to the extended property provided to a specific control.
[Visual Basic] <ExtenderProvidedProperty()> _ Public Sub SetAnimationToolTip( _ ByVal acontrol As Control, _ ByVal ds As AnimationTTDataSource)
[C#] [ExtenderProvidedProperty()] public void SetAnimationToolTip( Control acontrol, AnimationTTDataSource ds );
Parameters
acontrol
The target-control. The passed AnimationTTDatasource-object is attached to the extended property provided to this control by the tooltip-component.
ds
The new AnimationTTDatasource-object to attach to the extended property of acontrol.
Description
This method assigns the passed AnimationTTDatasource-object (ds) to the extended property provided to the specified control (acontrol) by the AnimationToolTip-component (ToolTipsFactoryAnimation). It is this object which holds the tooltip-content (and some other properties) used for the tooltip to be displayed for acontrol.
In the Visual Studio property-grid the access to the AnimationTTDatasource-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 assign a new or another instance of an AnimationTTDatasource-object to the extended property of a specific control through code, things are not exactly as one would expect: The AnimationTTDatasource-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 assign a new value to this property by code as to 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 AnimationToolTip-component). Therefore the programmatic access to this properties has to happen through the providing component. And that's where SetAnimationToolTip() comes into play. SetAnimationToolTip() tells the tooltip-component to set the passed AnimationTTDatasource-object (ds) as new value for the property provided to the specified control (acontrol).
The following example shows how this could look in code:
'Create a new AnimationTTDataSource Dim myToolTipDS As AnimationTTDataSourcemyToolTipDS = New AnimationTTDataSource
'We assign new content (a movie-clip retrieved from
'database)
myToolTipDS.AnimatedSymbol = GetMovie("ChangeCartridge")
'And - because we know that this movie contains
'interesting details - we have to make sure that it is 'displayed with an appropriate size. For this, 'we override the DefaultWidth defined by the 'tooltip-component with an adequate value.myToolTipDS.Override.DefaultWidth = 480
'Finally we can assign the new AnimationTTDataSource-object
'to the extended property provided to lblChangeCartridge
Me.videoTutorialTT.SetAnimationToolTip(Me.lblChangeCartridge, myToolTipDS)