views:

33

answers:

1

Hello I have a Toggle button in Silverlight.
I want to set its state to "pressed".

First I tried :

  btButton.IsPressed = true

But that does not work (readonly).
Then I tried :

btButton.SetValue(ToggleButton.IsPressedProperty, true);

Which also does not work. How do I accomplish this ? I'd assume it would not be that hard...

+1  A: 

Use IsChecked. IsPressed tells you whether the mouse or space bar is currently pressing the button. IsChecked tells you how the button is toggled.

 btButton.IsChecked = true;
Quartermeister
Well that was easy in hindsight. However you saved me a lot of time and frustration. Thanks.
Julian de Wit