How to set the ToolTip for the WPF ButtonAdv control?
The ScreenTip is an advanced ToolTip control, whose UI element appears like a small window with a header, footer and content when the mouse cursor is hovered over an associated control. The ScreenTip is derived from the ToolTip and contains the following properties such as:
- Description
- HelpIcon
- HelpText
- ImageSource
Description:
Gets or sets the ScreenTip description.
HelpIcon:
Gets or sets the image for HelpIcon.
HelpText:
Gets or sets the Text for ScreenTip.
ImageSource:
Gets or sets the Image that appears in ScreenTip.
Content:
Gets or sets the content of a content control.
Using the above properties, we can set the tooltip in different sections.
The following is an example that shows how the ScreenTip is used as a ToolTip for the ButtonAdv control. Please find the following code example below:
XAML:
<Window x:Class="ButtonAdvSample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ButtonAdvSample" xmlns:syncufsion="http://schemas.syncfusion.com/wpf" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525"> <Grid> <syncufsion:ButtonAdv VerticalAlignment="Center" x:Name="buttonadv" HorizontalAlignment="Center"/> </Grid> </Window>
C#:
ScreenTip sc = new ScreenTip(); sc.ImageSource =new BitmapImage(new Uri(@"/ButtonAdv_I126747;component/Images/CameraImage.png", UriKind.Relative)); sc.HelpText = "Used to take the photos"; sc.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom; sc.Width = 240; sc.Content = "Tap here to capture the photos"; sc.Description = "ScreenTip for ButtonAdv control"; ButtonAdv.ToolTip = sc;
Fig 1: The screenshot shows the ScreenTip applied as the tooltip for the ButtonAdv control.
Sample Links:
C#: How to use ToolTip in WPF Control C#
Conclusion
I hope you enjoyed learning about how to set the ToolTip for the WPF control.
You can refer to our WPF Button feature tour page to learn about its other groundbreaking feature representations. You can also explore our WPF Button documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!