I'm using Infragistics NetAdvantage 2010 in my Winforms application. This is the code for loading a custom tooltip on a button's mousehover.
private void button1_MouseHover(object sender, EventArgs e){ UltraToolTipInfo toolTipInfo = ultraToolTipManager1.GetUltraToolTip(button1); toolTipInfo.ToolTipTextStyle = ToolTipTextStyle.Formatted; ultraToolTipManager1.DisplayStyle = ToolTipDisplayStyle.Office2007; toolTipInfo.ToolTipTextFormatted = "" + "<p style='color:Black; font-family:tahoma;'>Details:</p>" + "<p style='color:Black; font-family:tahoma;'>Name: <t style='color:Black; font-family:tahoma; font-weight:bold;'>Sandeep</t></p>" + "<t style='color:Black; font-family:tahoma;'>Profile: <t style='color:Black; font-family:tahoma; font-weight:bold;'>Developer</t></t> ";}
But when I run this, the tooltip won't appear the first time when I do a mouse-hover. It starts coming from the second time onwards. What could be the problem here?
Hi,
I don't understand why you are using MouseHover or MouseEnter for this. If you want a tooltip to show up on the control, then you should be assigning it before MouseHover, like in the Form_Load or even at design-time.
MouseHover is what triggers the tooltip in the first place. So using MouseHover to assign the tooltip to the control is too late.