When developing a wpf app for work I ran into a display problem for the CheckBox and RadioButton. Most of our office computers still use windows XP with the classic theme and even the new Windows 7 computers are set to use the classic theme as well.
Originally, I wrote my RadioButton and CheckBox like so
Name=”radioButton1″ GroupName=”someGroup” Content=”Option 1″ />
<RadioButton Style="{StaticResource myRadio}"
As you can see the “Content” part is what determined my label for the defined RadioButton, and here is where the problem is. I am not sure why but the Classic theme in windows can’t render this properly causing the entire control to be inaccessible.
To fix this problem we need to remove “content” and link a label to the control. This is quite simple to do as you can see as follows:
<RadioButton Style="{StaticResource myRadio}" GroupName="someGroup" Name="radioButton1">
<Label>Option 1</Label>
</RadioButton>
I would like to know more why this is a problem on the classic theme but right now this workaround works great across all OS’s and themes
Leave a Reply