3
votes

Can anyone tell me how I can change the color of my checkmark for a checkbox in Silverlight for Windows Phone 7 development?

I see some references on the web for changing a template but that is more for WPF or SilverLight apps, not WP7.

Right now I have a white background on my stackpanel and my background for my checkboxes are black. It would be sweet to make the checkmark white.

Any ideas?

UPDATE:

I should mention that I'm creating these checkboxes in the code behind (via a loop), and I'm using VS 2010 for my phone app development.

The Answer:

Thanks to Mick who lead me down the right path. I had to fiddle with it a little but I used MS Blend to create my own style and then I copied the XAML from there and put that style XAML in the App.xaml in between the tags.

Then I applied it in my code behind like this:

chk.Style = (Style)Application.Current.Resources["CheckBoxStyle1"];
1

1 Answers

5
votes

You can access this by retemplating the control in Blend.

  • Target the check box.
  • Right click
  • Edit Template
  • Edit a Copy
  • Drill down to the CheckMark path
  • Change it's colour