Windows Develop Bookmark and Share   
 index > Windows Forms General > How Can I Make a DropShadow?
 

How Can I Make a DropShadow?

VS2005 - C# - Winforms

In my Borland days I could easily make a dropshadow by stacking two labels. I'd set the top (lighter colored text) label to transparent, then the bottom label with black text could be moved to just outline the top text making a dropshadow.

Is there a way to do this (without making a bitmap in a graphics program)?

BTW, I need this because I have a color-coded legend and there is no one background color that lets me read all the colored text.

Thanks,

Dennis
NDennisV  Sunday, November 25, 2007 1:37 PM

Hi Dennis,

If you would like to make a dropshadow with C#, I strongly recommend you checking out this article about "Transparent drop shadow in C# (GDI+)" for reference - http://www.codeproject.com/cs/miscctrl/TransparentDropShadowInCS.asp.

The trick is as follows: Using strategically placed and tiled pictures of a shadow, we can simulate a shadow effect. When transparent PNGs are used, it looks just like the real thing.

Hope this helps,

Regards,

Ji Cheng Wang - MSFT  Tuesday, November 27, 2007 5:30 AM

Hi Dennis,

If you would like to make a dropshadow with C#, I strongly recommend you checking out this article about "Transparent drop shadow in C# (GDI+)" for reference - http://www.codeproject.com/cs/miscctrl/TransparentDropShadowInCS.asp.

The trick is as follows: Using strategically placed and tiled pictures of a shadow, we can simulate a shadow effect. When transparent PNGs are used, it looks just like the real thing.

Hope this helps,

Regards,

Ji Cheng Wang - MSFT  Tuesday, November 27, 2007 5:30 AM

You can use google to search for other answers

Custom Search

More Threads

• Copy from List<string> to Array (string[])
• RSA File Encryption/Decryption using C#?
• MouseMove Event -> MousePosition
• Script on interval basis
• Create Trace in my application
• Double buffer panel : Run time error
• .NET forms with VB6 parent
• Visual Studio 2005 "Error Creating Window Handle" in Designer
• How to: Grab "default" value from databound combo-box which has not been modifed by user
• Odd Design Time Problem With Forms..