Custom drawing radio buttons

  • Thread starter Peter Morris [Droopy eyes software]
  • 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
 
F

Fabien

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 :
 
P

Peter Morris [Droopy eyes software]

Hi

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

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top