Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
750
Tooltip ONLY on the grid caption
posted

Howdy,

I'm trying to only show a tooltip when someone is hovering over the UltraGrid caption.

I've tried disabling the UItraToolTipManager in the hover, if it's not over the right UIElement but that's not working. 

Here's my code:

    private void ugAlerts_MouseHover(object sender, EventArgs e)
    {
      ultraToolTipManager1.Enabled = false;
     
      Point clientPt = ugAlerts.PointToClient(Cursor.Position);
      Object obj = ugAlerts.DisplayLayout.UIElement.ElementFromPoint(clientPt);
      if (obj.GetType() == typeof(Infragistics.Win.TextUIElement))
      {
        Infragistics.Win.TextUIElement tuie = obj as Infragistics.Win.TextUIElement;
        if (tuie.Parent.GetType() == typeof(Infragistics.Win.UltraWinGrid.CaptionAreaUIElement))
        {
          ultraToolTipManager1.Enabled = true;
        }
      }
    }

I really thinking I'm missing something simple....

Any guidance?

thanks!

Parents
  • 469350
    Offline posted

    Hi,

    You can't really use MouseHover to control tooltips, because MouseHover deals with the entire control. So, for example, if you hover the mouse over any part of the grid and the MouseHover event fires, then you move the mouse over some other part of the grid, the MouseHover event will not fire again. It only fires again if the mouse leaves the control and comes back in.

    If you want to change the tooltip on the grid based on the location of the mouse, then I recommend using the MouseMove event.

    By the way... I could be wrong, but I think the event args for MouseHover are in client coords, so you don't need to use PointToClient. In any case, I am certain this is true for MouseMove.

Reply Children