[Mono-winforms-list] Radiobutton Windows Look and Feel Issues: Take 2

John BouAntoun jba-mono@optusnet.com.au
Mon, 27 Sep 2004 22:29:54 +1000

Hey guys,

I redid my work with rendering the radio button control in the windows

This time i took the approach of minimising the number of calls to
Graphics.Drawxxxxx since I know from past experience that each call to
those is resource (and time) intensive.

I did some further research and can't seem to find any way at all to
pass in the FlatStyle.Popup property.

The problem seems to be two-fold:

1) The button rendering translates the Flatstyle to either
Appearance.Normal or Appearance.Flat when rendering. Using the current
translation there is no target for the popup flatstyle.

2) The button rendering never passes in any hover state information.
This is needed since the FlatStyle.Popup needs to render the popup state
when the mouse hovers over it.

The paint call stack runs like this

RadioButton.Redraw() -> ControlPaint.DrawRadioButton() ->
ThemeEngine.Current.DrawRadioButton (graphics, rectangle, butonstate) ->
DrawFrameControl(graphics, rectangle, DrawFrameControlTypes.Button,

All of the rendering of the radio part of the radiobutton is done in
DrawFrameControl. Is that right? Ravindra seems to think this is

Also using this call stack there still seems to be no way to pass in the
FlatStyle.Popup state and hover state of the radio button into
DrawFrameControl. I need help with this one?

We either need to change where the radiobutton's rendering is done, or
change the api of DrawFrameControl so that we can pass in the flatstyle
and hover detail. Can any more senior dev's recommend a direction?

Sorry for getting so "needy" on this, it's my first MWF control and all,
but this sounds like a common issue for all controls.

Help here would be appreciated.

In the meantime I can send in a patch of all my fixes so far (which is
basically a cleaned up version of yesterdays patch) if you want me to.