Creating a transparent UserControl
C#, Component Development, Graphics and Images February 23rd, 2006If you want to create a user control that is not rectangular and shows the parent control surface then you have to make the control transparent.
This can be achieved by adding the following to the UserControl’s constructor.
[csharp]
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
[/csharp]
May 26th, 2008 at 2:40 pm
this does not work.