Transparent Labels (FAO Bob Powell)

  • Thread starter Thread starter Hedley Muscroft
  • Start date Start date
H

Hedley Muscroft

Hi Bob (or anyone else who can help!),

I've just written a couple of simple new controls : TransparentLabel and
TransparentLinkLabel which are based on the example on your website :
http://www.bobpowell.net/transcontrols.htm

The onle changes I made were to remove the Timer and I added...
this.DoubleBuffered = false;

....to the constructor (which seemed to be required) and it all works fine,
except that when the form is resized, the label doesn't repaint itself and
hence disappears.

I'm guessing that the timer code would fix this because it invalidates the
control every 500msecs, but is there a better workaround? If a form has a
dozens of TransparentLabels, that means dozens of timers which I'd rather
avoid if possible.

Any suggestions? TIA,

Hedley Muscroft

PS: I'm using VS C# 2005 Beta 2
 
Thanks Bob - that was it!

Bob Powell said:
Have you overidden the OnSizeChanged method to call the InvalidateEx
method?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top