windowsforms-devexpress-dot-xtraeditors-dot-svgimagebox-e7551890.md
Gets or sets whether SvgImageItem objects owned by this control can show tooltips when users hover over these items.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
[DefaultValue(DefaultBoolean.Default)]
[DXCategory("ToolTip")]
public DefaultBoolean ShowToolTips { get; set; }
<DefaultValue(DefaultBoolean.Default)>
<DXCategory("ToolTip")>
Public Property ShowToolTips As DefaultBoolean
| Type | Default | Description |
|---|---|---|
| DefaultBoolean | Default |
Specifies whether items can show super tooltips and regular hints.
|
Available values:
| Name | Description | Return Value |
|---|---|---|
| True |
The value is true.
|
0
| | False |
The value is false.
|
1
| | Default |
The value is specified by a global option or a higher-level object.
|
2
|
SvgImageBox supports tooltips (regular hints and super tooltips) if the ShowToolTips property is enabled.
Use the following properties to specify regular tooltips:
SvgImageItem.ToolTip, SvgImageItem.ToolTipTitle, and SvgImageItem.ToolTipIconType—Allow you to assign regular tooltips to individual items.
SvgImageBox.ToolTip, SvgImageBox.ToolTipTitle, and SvgImageBox.ToolTipIconType—Allow you to display regular tooltips when a user hovers over an empty space, and over items without explicitly assigned tooltips.
Use the following properties to specify super tooltips:
The ToolTipController property allows you to assign a stand-alone controller and modify tooltips at runtime. To do that, handle the ToolTipController.BeforeShow event. Read the e.SelectedObject property to identify which item a user’s mouse pointer hovers over, and set the corresponding e.Tooltip or e.SuperTip value. The code sample below illustrates how tooltips are assigned to SvgImageBox items in the DevExpress “SvgImage Box” Demo Center module.
svgImageBox.ToolTipController = toolTipController;
toolTipController.BeforeShow +=
new DevExpress.Utils.ToolTipControllerBeforeShowEventHandler(this.OnBeforeShowToolTip);
void OnBeforeShowToolTip(object sender, Utils.ToolTipControllerShowEventArgs e) {
var svgImageItem = e.SelectedObject as SvgImageItem;
if(svgImageItem == null) return;
e.ToolTip = string.Format(
e.ToolTip,(svgImageItem.Tag as string).ToUpper(),
svgImageItem.Selected ? "Reserved" : "Free");
}
svgImageBox.ToolTipController = toolTipController
AddHandler toolTipController.BeforeShow, AddressOf OnBeforeShowToolTip
Private Sub OnBeforeShowToolTip(ByVal sender As Object, ByVal e As Utils.ToolTipControllerShowEventArgs)
Dim svgImageItem = TryCast(e.SelectedObject, SvgImageItem)
If svgImageItem Is Nothing Then
Return
End If
e.ToolTip = String.Format(e.ToolTip,(TryCast(svgImageItem.Tag, String)).ToUpper(),If(svgImageItem.Selected, "Reserved", "Free"))
End Sub
See Also