Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using VS2010 and I've found that The Button in WPF has a property named IsPressed and it is a readonly property ( I mean I can not assign it with true) but still I want to show my button in Pressed state manually, do you have any idea to do that?
Posted

You can have a look at this [^] article.

This explains how to simply animations for the pressed state of a button.
 
Share this answer
 
v2
Comments
Maciej Los 5-Jan-14 9:36am    
Interesting article ;)
+5!
Abhinav S 5-Jan-14 10:07am    
Thank you.
Hi The IsPressed property is read only, so we can only get its value from code. You can use ToggleButton instead, and set IsChecked property to true.
 
Share this answer
 
VisualStateManager.GoToState(<your button="">, "Pressed", true)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900