andradrr

Hello people.

Please, is there any way to programmatically display a balloon tooltip on any given location regardless the mouse position and hover message What I want is something like the notify icon balloon tooltip in the system tray area.

I know that I can do this with pure api, like I used to do in good old VB6 times, by creating a new tooltips class window, subclassing its messages and using SetWindowPos in order to position it where I need. But I was wondering if is there a .NET way to do this, in order to stay away from unmanaged code.

Any ideas and or suggestions are very welcomed.

Cheers,

Rodrigo.



Re: Windows Forms General Programmatically display a balloon tooltip.

Zhi-Xin Ye - MSFT

Try something like:

private void button1_Click(object sender, EventArgs e)

{

ToolTip tip = new ToolTip();

tip.ToolTipIcon = ToolTipIcon.Warning;

tip.IsBalloon = true;

tip.Show("hello!", this, new Point(1024, 768));

}

Hope it helps.
Best Regards.
Zhixin Ye






Re: Windows Forms General Programmatically display a balloon tooltip.

andradrr

Hello Zhixin Ye,

First of all, thank you very much for your reply!

This is exactly what I need. You solved my problem !

Again, thanks a lot.

Cheers,

Rodrigo.





Re: Windows Forms General Programmatically display a balloon tooltip.

andradrr

Hello again,

Now I have another issue...

The code you provide in your answer display the tooltip positioned by the top-left corner of the balloon. Is there any way to position it by the balloon pointer

I saw that I can get the balloon dimensions in the popup event, but I can't determine the orientation of the balloon neither reposition it based on the tooltip size.

Any ideas and/or suggestions are again very welcomed !!!

Cheers,

Rodrigo.





Re: Windows Forms General Programmatically display a balloon tooltip.

Ting Wang - MSFT

Could you help to clarify

As far as I can see, the code will display the balloon shaped tooltip based on the relative position of the control specified by the "this" pointer. So if "this" is a Windows form, and its postion on the screen is (100,100), the balloon shaped tooltip will be displayed on the screen at (100+1024, 100+768).

What position do you want to show the balloon shaped tooltip