Custom drawing radio buttons

  • Thread starter Thread starter Peter Morris [Droopy eyes software]
  • Start date Start date
P

Peter Morris [Droopy eyes software]

I want to draw a blue rounded-rect background on a radio button. Overriding
OnPaintBackground or OnPaint seems to do nothing as they are never called.
Can anyone recommend a way of creating a descendent control of RadioButton
with a custom appearance?

Thanks

Pete
 
Hi,

You must inherit from Radio Button and override the OnPaint method, as
following :

protected override void OnPaint(PaintEventArgs e) {

Graphics graphics = e.Graphics;

// Then draw your rectangle with the graphics object

}

BR


Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/




Peter Morris [Droopy eyes software] a écrit :
 
Hi

The point of my original post was that overriding OnPaint or
OnPaintBackground has no effect as they are never called.

Pete
 
Back
Top