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
150
Custom tooltip
posted

I want to use the Infragistics tooltips, since they offer more appearance customisation than the standard System.Windows.Forms.ToolTip. However, I am experiencing difficulties getting them to display at all.

 I have tried two methods. I’ll explain them below. This code is in my grid class, which extends UltraGrid.

 

1. Using UltraTooltipManager

 

private UltraToolTipInfo tooltip;

private UltraToolTipManager m_toolTipManager;

 

private void SetupToolTip()

{

      m_toolTipManager = new UltraToolTipManager();

           

      m_tooltip = new UltraToolTipInfo();

      m_tooltip.Appearance.FontData.Name = "Verdana";

      m_tooltip.ToolTipTitleAppearance.FontData.Name = "Verdana";

      m_tooltip.Enabled = DefaultableBoolean.True;           

}

 

...

 

public void ShowToolTip(string titleText_, string text_)

{

      m_tooltip.ToolTipText = text_;

      m_tooltip.ToolTipTitle = titleText_;

      m_toolTipManager.SetUltraToolTip(this, m_tooltip);

      Point loc = Cursor.Position;

      loc.Offset(16, 16);

      m_toolTipManager.ShowToolTip(this, loc);

}

 

2. Using Infragistics.Win.ToolTip

private Infragistics.Win.ToolTip m_tooltip;

private void SetupToolTip()

{

      m_tooltip = new Infragistics.Win.ToolTip(this);

      m_tooltip.TitleFont = NinePointRegularVerdanaFont.GetFont();

      m_tooltip.Font = NinePointBoldVerdanaFont.GetFont();

      m_tooltip.TopMost = true;

}

 

...


public void ShowToolTip(string titleText_, string text_)

{

      m_tooltip.ToolTipTitle = titleText_;

      m_tooltip.ToolTipText = text_;

      Point loc = Cursor.Position;

      loc.Offset(16, 16);

      m_tooltip.Show(loc);       

}
 

In both of these implementations, whenever I call ShowTooltip the tooltip just doesn’t appear. Using System.Windows.Forms.ToolTip I simply call the Show method and it works fine.

 

I’m stuck as to why neither of the above methods work. Does anyone have any insights?