views:

468

answers:

2

I wrote a C# application that is a simple countdown timer. I use it myself to keep track of cooking time (not to forget about boiling pasta) and other purposes.

It works in the tray. When hovering the icon it shows remaining time as a tooltip. When clicked it shows remaining time in a balloon tip. I would like displayed time to be "ticking down", i.e. to update every second.

How do I force update/redraw of the balloon and tool tip?

EDIT: I don't need to redraw the balloon itself. I only need time to be changing. In some sense I want to invalidate the balloon window, so that Windows will read text stored in BalloonText property and redraw it.

A: 

From your question it's not clear whether you want to graphically redraw the balloon or just update the time value. If you only want see the changing time value, you can use the Timer class.

Abbas
Thanks for the tip. I don't need to redraw the balloon itself. I just need ti update time value. I do use Timer class to update BalloonText property every second, but if balloon is displayed already the time is static.
Sergiy Byelozyorov
+2  A: 

As you may have surmised by now, the tooltip is displayed on mouse-over, and its content is static.

Your best bet might be to use an Outlook-Style notification window, as described in this article. You will have much better control over your displayed content.

Robert Harvey
Thanks the helpful answer. It's really troublesome that I have to create window just to display small tool-tip. Microsoft could have provided better interface for these purposes.
Sergiy Byelozyorov