I have ToolTips turned on to display when a user hovers over a text box. Currently the tooltip's display position seems to be based on where my mouse pointer is on the text box.
Is there a way to always set the tooltip position to a specified point regardless of the mouse pointer's position when hovering over the text box? For example, I always want the tooltip position to be in the upper left corner of the text box regardless of where the mouse pointer is hovering on the text box.
Thanks
Bill
Hi Bill,
What tooltip are you using? The Inbox ToolTip or UltraToolTipManager?
UltraToolTipManager allows you to specify exclusion areas and the exact point you want. There's a sample that does exactly what you describe, pointing a balloon tip at the corner of a control.
Thanks Mike.
Yes, I am using the UltraToolTipManager but I can't seem to find where I can set those properties. Can you help me out a little further?
Unfortunately none of ShowToolTip overrides takes Size or Rect, I had checked it before.
It seems the only thing I can do now is to cut the string manually and submit a feature request.
A quick update for those who might be interested:
The best solution is not to use UltraToolTipManager, but manually instantiate ToolTip class and call one of its Show() overloads as shown in the code snippet:
Infragistics.Win.ToolTip tt = new Infragistics.Win.ToolTip(this.ultraGrid1);
tt.ToolTipImage = ToolTipImage.Warning;
tt.ToolTipTitle = "Tool Tip Title";
tt.ToolTipText = "This is a very long tool tip text This is a very long tool tip text This is a very long tool tip text This is a very long tool tip text ";
tt.Show(new Rectangle(Control.MousePosition.X, Control.MousePosition.Y, 100, 100));
Remember to use ToolTip class, not UltraToolTip which does not exist...
Big thanks to Jason from Infragistics Team for his support.
Ralph
I have been trying to use the .show method as described above, but my tooltip balloon always locates at x-position "0".
That is, it always locates at the left edge of my screen. Can you tell me why this is happening?
Thanks,
Dan
Below is actual code from a short demo I created when discussing a tooltip bug with the development team. Try creating a form with a button btToolTip whose Click event would trigger this method:
private void btToolTip_Click(object sender, EventArgs e) { Infragistics.Win.ToolTip tt = new Infragistics.Win.ToolTip(this); tt.ToolTipTitle = "Tooltip Title"; tt.ToolTipText = "Tooltip text"; tt.Show(this.RectangleToScreen(new Rectangle(50, 120, 100, 100))); }
Your code was working until I inserted this line below
tt.DisplayStyle = ToolTipDisplayStyle.BalloonTip;
For some reason, setting the DisplayStyle to BalloonTip forces the tooltip to hug the left edge of the form.
If your tooltips are extending off the screen, then something is wrong. That hould never happen. Do you have the latest Hot Fix? If you do and that is still happening, then you should Submit an incident to Infragistics Developer Support.
A balloon tip is more like a speech balloon in a cartoon, where there's a callout (an arrow) pointing to something.
The problem with this is:...
I am trying to display information that is in a textbox, but the textbox is too small to display ALL the info. Since I dont' want to have a huge textbox on my form, I wish to solve this problem by using the tooltip to display the textbox info when hovering over it. Since there IS alot of text in the box, this generates a tooltip that is wider than the screen (ie. one line of text). The text in the tooltip WILL wrap, if the size of the tooltip is defined to be taller and not so wide. As a solution, I have parsed out the text information and included carriage-return/line feeds between lines of text. This changes the dimensions of the tooltip balloon. What's the difference between defining a standard tooltip or a Balloon Tooltip anyway??
I don't think it's possible to specific the size when using a BalloonTip. You wouldn't want to, anyway. Determining the size including the callout would be practically impossible. You can only specify the point that the balloon's callout points to.
I guess a method could be exposed where you specify the size of the balloon not including the callout. You should Submit a feature request to Infragistics
Now if I use the DisplayStyle statement with the simple tt.Show() statement, everything works fine, but I want to be able to adjust the tt size
So it looks like the combination of using the DisplayStyle statement with the more complex tt.Show(x,x,x,x,x)-type statement is when this quirk takes place.