Drop shadow in Winforms Controls?

Luiscencio picture Luiscencio · Mar 17, 2010 · Viewed 40.3k times · Source

is there a way to add a drop shadow to controls?

are there any controls out there with this feature?

Answer

Simon Linder picture Simon Linder · Mar 17, 2010

You have to overwrite the CreateParamsproperty like this:

private const int CS_DROPSHADOW = 0x00020000;
protected override CreateParams CreateParams
{
    get
    {
        // add the drop shadow flag for automatically drawing
        // a drop shadow around the form
        CreateParams cp = base.CreateParams;
        cp.ClassStyle |= CS_DROPSHADOW;
        return cp;
    }
}