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

Total Post:101

Points:707
Posted on    January-25-2014 1:25 AM

 C# C# 
Ratings:


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

How can I create this from code ?

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

            <Setter Property="Content">

                <Setter.Value>

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

                </Setter.Value>

            </Setter>

        </Style>



Pravesh Singh

Total Post:411

Points:2881
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