Home > DeveloperSection > Forums > Create CheckBox Style from code behind
Mark Devid
Mark Devid

Total Post:102

Posted on    January-25-2014 1:25 AM

 C# C# 

 1 Reply(s)
 1311  View(s)
Rate this:

How can I create this from code ?

<Style x:Key="CheckBoxStyle" TargetType ="{x:Type CheckBox}">

            <Setter Property="Content">


                    <TextBlock Foreground="Blue" TextDecorations="Underline" FontWeight="Bold" />




Pravesh Singh

Total Post:412

Posted on    January-25-2014 1:47 AM

Hi Mark,

Try this:

chkBox.Content = new TextBlock() {

                                Text = "hello",

                                Foreground = new SolidColorBrush(Colors.Blue),

                                TextDecorations = TextDecorations.Underline 


Don't want to miss updates? Please click the below button!

Follow MindStick