Share via


How to: Give Your Control a Transparent Background

 

In earlier versions of the .NET Framework, controls didn't support setting transparent backcolors without first setting the SetStyle method in the forms's constructor. In the current framework version, the backcolor for most controls can be set to Transparent in the Properties window at design time, or in code in the form's constructor.

Note

Windows Forms controls do not support true transparency. The background of a transparent Windows Forms control is painted by its parent.

Note

The Button control doesn't support a transparent backcolor even when the BackColor property is set to Transparent.

To give your control a transparent backcolor

See Also

FromArgb
Developing Custom Windows Forms Controls with the .NET Framework
Using Managed Graphics Classes
How to: Draw Opaque and Semitransparent Lines