I’m in the stages of making a program which will require a tabpage to flash when an event happens
I’ve googled around, and i came across this: Blink tab header on receiving event. This is similar, but uses WPF, and i’m using WinForms, and i’m not even sure that does what i want :L
I’ve also found this: C#: Flash Window in Taskbar via Win32 FlashWindowEx. This is what i want, but obvious for the whole form, and in the taskbar, not ‘in form’
Anyone got any ideas?
I’m not saying this is the best way or even a great way to accomplish this, but it does work. I’ve used code similar to this when I needed to something similar.
The tabControl1 has two tabs and I blink tab 1 (the second tab).
For my example that I threw together, I set tabControl1’s
DrawModeproperty to “OwnerDrawFixed” and then a couple of buttons which start/stop the timer. The interval was something like 750ms but you could choose whatever, of course. On atimer1_Tickevent, I swap out the current color and tell thetabControl1to refresh itself. That’ll make theDrawItemevent get raised and then I either draw the rectangle the current color if it is tab page 1 or the backcolor if not. Then I draw the tabpage’s text.It works. Could use some tweaking for sure. Give it a whirl!