Adding Screen Tips
Screen tips give you a mechanism to provide extended tooltips for any element within a Telerik RadRibbonBar.
Creating a Screen Tip
To create a screen tip, follow these steps:
Select an element on a RadRibbonBar control such as a RadButtonElement.
Click the drop-down arrow in the element's ScreenTip property.
Select the Telerik.WinControls.UI.RadOffice2007ScreenTipElement template.
Use the embedded property sheet to customize the screen tip.
Modifying a Screen Tip
To modify an existing screen tip, follow these steps:
Select the element whose screen tip you wish to customize.
Expand the ScreenTip property.
Click the ellipsis button in the TipItems collection.
Use the RadItems Collection Editor to change the properties of any part of the screen tip.
Adding Screen Tips Programmatically
There are several options for Office 2007-like screen tips we introduced in 2008 R3 for your convenience.
To completely customize the screen tips appearance, its size, text wrapping, etc you may handle the ScreenTipNeeded event of any RadControl (RadRibbonBar, RadGridView, etc) and customize the screen tip provided by the event arguments, or even assign a new ScreenTip object to the corresponding item.
Using ScreenTipNeeded
private void radRibbonBar1_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
{
RadButtonElement buttonElement = e.Item as RadButtonElement;
if (buttonElement != null && buttonElement.Text == "Button 1")
{
screenTip.CaptionLabel.Text = "Paste (Ctrl + V)";
screenTip.MainTextLabel.Text = "Add content from the Clipboard to your document";
buttonElement.ScreenTip = this.screenTip;
}
}
Private Sub RadRibbonBar1_ScreenTipNeeded(sender As Object, e As ScreenTipNeededEventArgs)
Dim buttonElement As RadButtonElement = TryCast(e.Item, RadButtonElement)
If buttonElement IsNot Nothing AndAlso buttonElement.Text = "Button 1" Then
screenTip.CaptionLabel.Text = "Paste (Ctrl + V)"
screenTip.MainTextLabel.Text = "Add content from the Clipboard to your document"
buttonElement.ScreenTip = Me.screenTip
End If
End Sub
The code sample below adds screen tips to two button elements in the RadRibbonBar:
Directly Acess Elements
RadOffice2007ScreenTipElement tip1 = new RadOffice2007ScreenTipElement();
tip1.CaptionLabel.Text = "Button1";
tip1.MainTextLabel.Text = "My Text";
RadOffice2007ScreenTipElement tip2 = new RadOffice2007ScreenTipElement();
tip2.CaptionLabel.Text = "Button2";
tip2.MainTextLabel.Text = "My Text";
this.radButtonElement2.ScreenTip = tip1;
this.radButtonElement3.ScreenTip = tip2;
Dim tip1 As New RadOffice2007ScreenTipElement()
tip1.CaptionLabel.Text = "Button1"
tip1.MainTextLabel.Text = "My Text"
Dim tip2 As New RadOffice2007ScreenTipElement()
tip2.CaptionLabel.Text = "Button2"
tip2.MainTextLabel.Text = "My Text"
Me.RadButtonElement2.ScreenTip = tip1
Me.RadButtonElement3.ScreenTip = tip2