Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

ShowToolTip Event, SftTree Class

Occurs when a tooltip is about to be displayed.

Class: SftTree
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public event ShowToolTipEventHandler ShowToolTip;
Public Event ShowToolTip As ShowToolTipEventHandler

Comments

Occurs when a tooltip is about to be displayed.

The event handler can modify fields in the ToolTipEventArgs object to control the appearance and contents of the tooltip.

Examples

C#

            sftTree1.Footers.Rows = 0;
            sftTree1.Dimensions.LevelIndent = 5; // indent just a few pixels for level 1 items
            sftTree1.TreeLineStyle = TreeLineStyleEnum.None;
            sftTree1.ShowExpandCollapseButtons = ShowExpandCollapseButtonsEnum.None;
            sftTree1.RowHeaders.Width = 0;
            sftTree1.ShowFocusRectangle = false;
            sftTree1.ItemClick += sftTree1_ItemClick;
            sftTree1.ItemDoubleClick += sftTree1_ItemDoubleClick;
            sftTree1.ShowToolTip += new SftTree.ShowToolTipEventHandler(sftTree1_ShowToolTip);
            sftTree1.ToolTip.ShowAlways = true;
            sftTree1.ToolTip.Style = ToolTipAppearanceEnum.Balloon;

            ItemClass cat;
            cat = AddCategory("Category 1");
             AddItem(cat, img, "Item 1");
             AddItem(cat, img, "Item 2");

VB.NET

End Sub

Private Sub sftTree1_ItemDoubleClick(ByVal sender As Object, ByVal e As Softelvdm.SftTreeNET.ItemClickEventArgs) Handles sftTree1.ItemDoubleClick
    If e.MouseEv.Button = Windows.Forms.MouseButtons.Left And e.Area = ItemClickAreaEnum.CellSel Then
        ClickCategory(e.Item)
    End If
End Sub

Private Sub sftTree1_ShowToolTip(ByVal sender As Object, ByVal e As Softelvdm.SftTreeNET.ToolTipEventArgs) Handles sftTree1.ShowToolTip
    Dim item As ItemClass = e.Cell.OwningItem
    e.ToolTipText = item.TagString
End Sub

' This is a small helper routine to show all properties and fields of an object
Private Sub DumpValues(ByVal o As Object)
    Dim api() As PropertyInfo = o.GetType().GetProperties()

See Also SftTree Class | Classes | SftTree/NET 2.0