开发者

Silverlight Togglebutton Set IsPressed state

开发者 https://www.devze.com 2023-01-14 23:29 出处:网络
Hello I have a Toggle button in Silverlight. I want to set its state to \"pressed\". First I tried : btButton.IsPressed = true

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(ToggleB开发者_如何转开发utton.IsPressedProperty, true);

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


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;
0

精彩评论

暂无评论...
验证码 换一张
取 消