Dose any one have an idea on how to make a shadow for a c# winforms control, i know that this question was around for a long time, and there is a lot of complicated answers out there, if we can create a function that you give it a control as parameter and draw a shadow for that control,
public static void DrawShadow(Control control, Graphics g, Color shadowColor, ShadowDepth depth) //ShadowDepth is an enum
{
switch (depth)
{
case ShadowDepth.z_depth_1:
DrawShadow(control, g, shadowColor, 1); // 1px shadow
break;
case ShadowDepth.z_depth_2:
DrawShadow(control, g, shadowColor, 2); // 2px shadow
break;
case ShadowDepth.z_depth_3:
DrawShadow(control, g, shadowColor, 3); // 3px shadow
break;
case ShadowDepth.z_depth_4:
DrawShadow(control, g, shadowColor, 4); // 4px shadow
break;
case ShadowDepth.z_depth_5:
DrawShadow(control, g, shadowColor, 5); // 5px shadow
break;
}
}
private static void DrawShadow(Control control, Graphics g, Color shadowColor, int depth)
{
}
so that we can get result like this:
any ideas on how can we approach that