public
partial
class
UserControl1 : UserControl
{
public
UserControl1()
{
InitializeComponent();
//设置Style支持透明背景色
this
.SetStyle(ControlStyles.SupportsTransparentBackColor,
true
);
this
.BackColor = Color.FromArgb(0, 0, 0, 0);
}
protected
override
void
OnPaint(PaintEventArgs e)
{
base
.OnPaint(e);
e.Graphics.DrawString(
"test"
,
new
Font(
"Tahoma"
, 8.25f), Brushes.Red,
new
PointF(20, 20));
}
}