B4J Question How to flash / blink a form on taskbar

BarryW

Active Member
Licensed User
Longtime User
Hi masters. I'am creating a simple chat application and it works fine. But i want to nofity the user if it has a new message by flashing or blinking the forms icon on taskbar. Thanks for someone can help me...
 

Roycefer

Well-Known Member
Licensed User
Longtime User
The way I've done this is by creating two versions of an icon. One with a transparent background and one with a red background. Then, when I want the icon to "flash", I enable a Timer and in the timer_tick event, I change the MainForm's Icon to the normal icon, then back to the icon with the red background and back again, so forth and so on with each tick. Disable the Timer to stop the flashing (you might also want to set the icon back to the normal one, if desired). Adjust the Timer interval to make the flashing period to your liking. 500 ms is a good place to start. Don't make the interval too small or you'll induce seizure in your users.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…