J
JezB
I'm creating a custom control (inheriting from base windows control
RadioButton). I want the background for the control to be transparent, so in
the OnPaint method the first thing I do is clear the client rectangle with a
transparent colour:
protected override void OnPaint(PaintEventArgs pea)
{
Graphics g = pea.Graphics;
g.Clear(Color.Transparent);
// now paint over this
}
but this is making the background black rather than transparent. Leaving
this out and just painting what I want while leaving areas of the client
rectangle unpainted leaves a residue from what was painted there before (eg.
when I uncheck the radio button). What am I doing wrong ?
RadioButton). I want the background for the control to be transparent, so in
the OnPaint method the first thing I do is clear the client rectangle with a
transparent colour:
protected override void OnPaint(PaintEventArgs pea)
{
Graphics g = pea.Graphics;
g.Clear(Color.Transparent);
// now paint over this
}
but this is making the background black rather than transparent. Leaving
this out and just painting what I want while leaving areas of the client
rectangle unpainted leaves a residue from what was painted there before (eg.
when I uncheck the radio button). What am I doing wrong ?