I have an UltraToolTipManager control on a form.
In certain cases an UltraGrid control on the form has ToolTipInfo set.
The command I use to set the tool tip is:
Me.UltraToolTipManager.SetUltraToolTip(Me.UltraGrid1, New UltraToolTipInfo("My message here", ToolTipImage.Warning, Nothing, DefaultableBoolean.False))
This UltraGrid control also handles the MouseHover event
Private sub UltraGrid1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.UltraGrid1.MouseHover
Me.UltraToolTipManager1.ShowToolTip(Me.UltraGrid1)
End Sub
How can I check the control for existing ToolTipInfo before I call ShowToolTip?
Thanks for your help in advance
Hi,
You can use the GetUltraToolTip method to get the ToolTipInfo on the grid. This will always return an object, but you could look at the ToolTipText to see if there is anything there.
Yes, the online documentation for GetUltraToolTip says that if a ToolTipInfo does not exist for the specified control then one is created.
I guess I was hoping that there would be something like UltraToolTipManager1.Exists that I could call and it would not produce a side effect of making new objects.
Hm, I see your point. There isn't any way to do that right now. But that would be very easy for us to add. I recommend that you Submit a feature request to Infragistics.
In the mean time, you could use GetUltraToolTip and then check the ToolTipText & ToolTipTextFormatted, and if they are both empty, you could use SetUltraToolTip and set it to null. The UltraToolTipInfo would still get created, but setting it to null will destroy it.