event HighLightItem (OldItem as Item, NewItem as Item)
Occurs when an item is highlighted.

 TypeDescription 
   OldItem as Item An Item object being un-highlighted.  
   NewItem as Item An Item object being highlighted.  

Use the HighLightItem event to notify your application that an item is highlighted. The HighLightItem event occurs when cursor hovers the item. The HighlightItemType property specifies the way how the control marks the highlighted item. Use the HyperLinkColor property to specify the item's foreground color when the cursor hovers the mouse. Use the ForeColor property to specify the item's foreground color. Use the AllowHighLight property to avoid highlighting an item when the cursor hovers it.

The following VB sample bolds the highlighted item:

Private Sub ExplorerBar1_HighLightItem(ByVal OldItem As EXPLORERBARLibCtl.IItem, ByVal NewItem As EXPLORERBARLibCtl.IItem)
    If Not OldItem Is Nothing Then
        OldItem.Bold = False
    End If
    If Not NewItem Is Nothing Then
        NewItem.Bold = True
    End If
End Sub

The following C++ sample bolds the highlighted item:

void OnHighLightItemExplorerbar1(LPDISPATCH OldItem, LPDISPATCH NewItem) 
{
	CItem oldItem( OldItem ); oldItem.m_bAutoRelease = FALSE;
	CItem newItem( NewItem ); newItem.m_bAutoRelease = FALSE;
	if ( oldItem.m_lpDispatch != NULL )
		oldItem.SetBold( FALSE );
	if ( newItem.m_lpDispatch != NULL )
		newItem.SetBold( TRUE );
}

The following VB.NET sample bolds the highlighted item:

Private Sub AxExplorerBar1_HighLightItem(ByVal sender As Object, ByVal e As AxEXPLORERBARLib._IExplorerBarEvents_HighLightItemEvent) Handles AxExplorerBar1.HighLightItem
    If Not e.oldItem Is Nothing Then
        e.oldItem.Bold = False
    End If
    If Not e.newItem Is Nothing Then
        e.newItem.Bold = True
    End If
End Sub

The following C# sample bolds the highlighted item:

private void axExplorerBar1_HighLightItem(object sender, AxEXPLORERBARLib._IExplorerBarEvents_HighLightItemEvent e)
{
	if (e.oldItem != null)
		e.oldItem.Bold = false;
	if (e.newItem != null)
		e.newItem.Bold = true;
}

The following VFP sample bolds the highlighted item:

*** ActiveX Control Event ***
LPARAMETERS olditem, newitem

If !isnull(OldItem)
    OldItem.Bold = .f.
EndIf
If !isnull(NewItem)
    NewItem.Bold = .t.
EndIf

 


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.