How can I create this from code ?
<Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
<SetterProperty="Content">
<Setter.Value>
<TextBlock Foreground="Blue" TextDecorations="Underline" FontWeight="Bold" />
</Setter.Value>
</Setter>
</Style>
Pravesh Singh
25-Jan-2014Try this:
chkBox.Content = new TextBlock() {Text ="hello",
Foreground =new SolidColorBrush(Colors.Blue),
TextDecorations= TextDecorations.Underline
};