Adding ToolTips to C1Slider
You can use ToolTips to add information or instructions to C1Slider. The C1Slider control includes properties to add ToolTips to the control, the Increment and Decrement buttons, and the slider's thumb. You can set these ToolTips using the ToolTip, IncrementToolTip, DecrementToolTip, and ThumbToolTip properties in Source view, Design view, or in code.
In Source View
In Source view, add text to the <cc1:C1Slider> tag so it appears similar to the following:
<cc1:C1Slider ID="C1Slider1" runat="server" ToolTip="I am a slider control." IncrementToolTip="Push this button to increase my value." DecrementToolTip="Push this button to decrease my value." ThumbToolTip="Move this button to change my value." />
The ToolTip, IncrementToolTip, DecrementToolTip, and ThumbToolTip properties will be set.
In Design View
You can select a Visual Style to apply from the Properties window:
1. Click on the C1Slider control to select it.
2. Navigate to the Properties window and, if needed, expand the Behavior node.
3. Set the following properties in the Properties window to set the ToolTip, IncrementToolTip, DecrementToolTip, and ThumbToolTip properties:
• Set the ToolTip property to "I am a slider control."
• Set the IncrementToolTip property to "Push this button to increase my value."
• Set the DecrementToolTip property to "Push this button to decrease my value."
• Set the ThumbToolTip property to "Move this button to change my value."
In Code
Add the following code to the Page_Load event to ToolTip, IncrementToolTip, DecrementToolTip, and ThumbToolTip properties:
Me.C1Slider1.ToolTip = "I am a slider control."
Me.C1Slider1.IncrementToolTip = "Push this button to increase my value."
Me.C1Slider1.DecrementToolTip = "Push this button to decrease my value."
Me.C1Slider1.ThumbToolTip = "Move this button to change my value."
• C#
this.C1Slider1.ToolTip = "I am a slider control.";
this.C1Slider1.IncrementToolTip = "Push this button to increase my value.";
this.C1Slider1.DecrementToolTip = "Push this button to decrease my value.";
this.C1Slider1.ThumbToolTip = "Move this button to change my value.";
Run your project and observe:
Tooltips will now appear at run time when the mouse hovers over the control, the Increment button, the Decrement button, and the slider's thumb:
|