I am trying to show tooltips and I am using the MouseEnterElement and MouseLeaveElement events to do so. I have button in my combo in the ButtonsLeft collection. The problem I am having is that I am getting tooltips twice: once when the mouse enters the combo and once when it enters the button UIelement. Is there a way to tell when I enter the Button that I can get to the tooltip on the combo itself and remove it?
Hi,
There's not really enough information here to go on. How are you showing the tooltips? Are you using the inbox tooltips or the UltraToolTipManager?
What is your code doing exactly?
Can you post a small sample project demonstrating the behavior you are getting so we can check it out?
Here's my code in the MouseEnterElement event:
Public Sub grdGrid_MouseEnterElement(ByVal sender As Object, ByVal e As Infragistics.Win.UIElementEventArgs)
'this event handler sets the tooltip for a grid cell from our custom class...
Dim grdGrid As E2Grid = DirectCast(sender, E2Grid)
If TypeOf grdGrid.FindForm Is E2FormDefinition Then
Dim TheForm As E2FormDefinition = DirectCast(grdGrid.FindForm, E2FormDefinition)
Dim strToolTip As String = String.Empty
Dim blnRequired As Boolean = False
Dim strFormat As String = String.Empty
'see what type of UI element we are in...
If e.Element.GetType().Equals(GetType(Infragistics.Win.UltraWinEditors.EditorButtonUIElement)) Then
'we are in a grid editor button...
e.Element.ToolTipItem =
New EditorButtonToolTipProvider()
ElseIf e.Element.GetType().Equals(GetType(Infragistics.Win.UltraWinGrid.HeaderUIElement)) Then
'we are in a grid column header...
Dim objColumnHeaderUIElement As Infragistics.Win.UltraWinGrid.HeaderUIElement = DirectCast(e.Element, Infragistics.Win.UltraWinGrid.HeaderUIElement)
If Not objColumnHeaderUIElement Is Nothing Then
Dim aColumnHeader As Infragistics.Win.UltraWinGrid.HeaderBase = objColumnHeaderUIElement.Header
If Not aColumnHeader Is Nothing Then
If Not aColumnHeader.Column Is Nothing Then
Dim objGridColumn As clsGridColumn = Nothing
Call GetToolTipInfoForGridColumn(grdGrid, aColumnHeader.Band.Index, aColumnHeader.Column.Key, blnRequired, strToolTip, strFormat, objGridColumn)
Call SetToolTip(TheForm, grdGrid, blnRequired, strToolTip, strFormat, False, objGridColumn)
End If
ElseIf e.Element.GetType().Equals(GetType(CellUIElement)) Then
'we are in a grid cell...
Dim objCell As UltraGridCell = DirectCast(e.Element.GetContext(GetType(UltraGridCell)), UltraGridCell)
If Not objCell Is Nothing Then
If objCell.Column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button Then
'don't show a tooltip if the column's style is button. We will
'show the tool tip when the editor button element is entered. If
'we did show the tooltip here, we'd see two of them popup at once...
Else
Call GetToolTipInfoForGridColumn(grdGrid, objCell.Band.Index, objCell.Column.Key, blnRequired, strToolTip, strFormat, objGridColumn)
Call CheckForHyperlinkInMouseEnterElement(grdGrid, e)
End Sub
Here's my code from the MouseLeaveElement event:
Private
Sub grdGrid_MouseLeaveElement(ByVal sender As Object, ByVal e As Infragistics.Win.UIElementEventArgs)
'this event handler clears the tooltip for the passed in grid...
If Not IsNothing(e.Element.ToolTipItem) Then
Nothing
ElseIf e.Element.GetType().Equals(GetType(Infragistics.Win.UltraWinEditors.EditorButton)) Then
Call SetToolTip(TheForm, grdGrid, False, String.Empty, String.Empty, True)
ElseIf e.Element.GetType().Equals(GetType(Infragistics.Win.UltraWinGrid.CellUIElement)) Then
Hello,
Please let us know if you need any other assistnace.