question

Wami007-9389 avatar image
1 Vote"
Wami007-9389 asked henrihan-8261 answered

C++/CLI Adding shadow to panel

  •  Hello Everyone....!
    

i am trying to add simple shadow to Panel in my User Form but can't find resource on right way. Can anyone help for it or convert attached c# code for apply able to Panel **

private const int CS_DropShadow = 0x00020000;

protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ClassStyle != CS_DropShadow;
return cp;
}
}

dotnet-csharpc++dotnet-runtime
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Viorel-1 avatar image
0 Votes"
Viorel-1 answered

According to documentation, the CS_DROPDOWN style is available for top-level windows only, not for controls.

You can simulate simple shadow using an additional empty panel. For example, if your panel is called panel1, you can insert another one programmatically:

 auto shadow = gcnew Panel;
 shadow->Size = panel1->Size;
 shadow->Left = panel1->Left + 4;
 shadow->Top = panel1->Top + 4;
 shadow->BackColor = Color::FromArgb( 0xAAD3D3D3 );
 shadow->BorderStyle = BorderStyle::None;
 panel1->Parent->Controls->Add( shadow );
 shadow->SendToBack( );

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

henrihan-8261 avatar image
0 Votes"
henrihan-8261 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.