Occurs when the user clicks on a hyperlink cell.
![]() | Type | Description | ||
| Item as HITEM | A long expression that indicates the item's handle. | |||
| ColIndex as Long | A long expression that indicates the column's index. |
The HyperLinkClick event is fired when user clicks a hyperlink cell. A hyperlink cell has the CellHyperLink property on True. The control changes the shape of the cursor when the mouse hovers a hyper linkcell. Use the HyperLinkClick event to notify your application that a hyperlink cell is clicked. Use the HyperLinkColor property to specify the hyperlink color. The HyperLinkClick event is fired only if the user clicks a cell that has the CellHyperLink property on True. Use the ItemFromPoint property to get an item or a cell from point. Use the ColumnFromPoint property to get the column from point.
The following VB sample displays the caption of the hyperlink cell that's been clicked:
Private Sub G2antt1_HyperLinkClick(ByVal Item As EXG2ANTTLibCtl.HITEM, ByVal ColIndex As Long)
Debug.Print G2antt1.Items.CellValue(Item, ColIndex)
End Sub
The following VC sample displays the caption of the hyperlink cell that's been clicked:
#include "Items.h"
static CString V2S( VARIANT* pv, LPCTSTR szDefault = _T("") )
{
if ( pv )
{
if ( pv->vt == VT_ERROR )
return szDefault;
COleVariant vt;
vt.ChangeType( VT_BSTR, pv );
return V_BSTR( &vt );
}
return szDefault;
}
void OnHyperLinkClickG2antt1(long Item, long ColIndex)
{
CItems items = m_g2antt.GetItems();
COleVariant vtItem( Item ), vtColumn( ColIndex );
OutputDebugString( V2S( &items.GetCellValue( vtItem, vtColumn ) ) );
}
The following VB.NET sample displays the caption of the hyperlink cell that's been clicked:
Private Sub AxG2antt1_HyperLinkClick(ByVal sender As Object, ByVal e As AxEXG2ANTTLib._IG2anttEvents_HyperLinkClickEvent) Handles AxG2antt1.HyperLinkClick
With AxG2antt1.Items
Debug.WriteLine(.CellValue(e.item, e.colIndex))
End With
End Sub
The following C# sample displays the caption of the hyperlink cell that's been clicked:
private void axG2antt1_HyperLinkClick(object sender, AxEXG2ANTTLib._IG2anttEvents_HyperLinkClickEvent e)
{
System.Diagnostics.Debug.WriteLine( axG2antt1.Items.get_CellValue(e.item, e.colIndex ) );
}
The following VFP sample displays the caption of the hyperlink cell that's been clicked:
*** ActiveX Control Event *** LPARAMETERS item, colindex with thisform.G2antt1.Items .DefaultItem = item wait window nowait .CellValue( 0, colindex ) endwith