property Editor.ItemToolTip(Value as Variant) as String
Gets or sets the text displayed when the mouse pointer hovers over a predefined item.

 TypeDescription 
   Value as Variant A long expression that indicates the value of the item whose tooltip is accessed, a string expression that indicates the caption of the item whose tooltip is accessed.   
   String A string expression that may include HTML tags, that indicates the text being displayed when the mouse hovers the item.   
Use the ItemToolTip property to assign a tooltip for a drop down list value. Use the AddItem or InsertItem methods to insert new items to the drop down predefined list. The ItemToolTip property may include HTML tags that are listed here here

The following VB sample adds a predefined value that displays a tooltip when the cursor hovers the value in the drop down portion of the editor:

With G2antt1.Columns(0).Editor
    .EditType = DropDownListType
    .AddItem 1, "Root Item"
    .ItemToolTip(1) = "This is a bit of text that should appear when the cursor <b>hovers</b> the item."
    .InsertItem 2, "Child Item", , 1
End With

The following C++ sample adds a predefined value that displays a tooltip when the cursor hovers the value in the drop down portion of the editor:

#include "Items.h"
#include "Editor.h"
COleVariant vtMissing; V_VT( &vtMissing) = VT_ERROR;
CItems items = m_g2antt.GetItems();
CEditor editor = items.GetCellEditor( COleVariant( items.GetFirstVisibleItem() ), COleVariant( long(0) ) );
editor.SetEditType( 3 /*DropDownListType*/ );
editor.AddItem( 0, "tooltip", vtMissing );
editor.SetItemToolTip( COleVariant( "tooltip" ), "This is a bit of text that should appear when cursor hovers the item.");

The following VB.NET sample adds a predefined value that displays a tooltip when the cursor hovers the value in the drop down portion of the editor:

With AxG2antt1.Items
    With .CellEditor(.FirstVisibleItem, 0)
        .EditType = EXG2ANTTLib.EditTypeEnum.DropDownListType
        .AddItem(0, "tooltip")
        .ItemToolTip(0) = "This is a bit of text that should appear when cursor hovers the item."
    End With
End With

The following C# sample adds a predefined value that displays a tooltip when the cursor hovers the value in the drop down portion of the editor:

EXG2ANTTLib.Items items = axG2antt1.Items;
EXG2ANTTLib.Editor editor = items.get_CellEditor(items.FirstVisibleItem, 0);
editor.EditType = EXG2ANTTLib.EditTypeEnum.DropDownListType;
editor.AddItem(0, "tooltip", null);
editor.set_ItemToolTip(0, "This is a bit of text that should appear when cursor hovers the item.");

The following VFP sample adds a predefined value that displays a tooltip when the cursor hovers the value in the drop down portion of the editor:

with thisform.G2antt1.Items
	With .CellEditor(.FirstVisibleItem, 0) 
		.EditType = 3 && DropDownListType
        .AddItem(0, "tooltip")
        .ItemToolTip(0) = "This is a bit of text that should appear when cursor hovers the item."
	EndWith
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.