Click here to Skip to main content
15,889,861 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want create a WPF desktop application
when click the button, the button will move from left to right.
is it possible to do that??
if possible provide some example.

i try search through internet, but cannot find the answer that i need.

Thank you very much.
Posted

1 solution

Try this code :
C#
if (button1.HorizontalAlignment == HorizontalAlignment.Left)
               button1.HorizontalAlignment = HorizontalAlignment.Right;
           else
               button1.HorizontalAlignment = HorizontalAlignment.Left;
 
Share this answer
 
v2
Comments
lailailaihou 14-Dec-12 2:55am    
yup it work for me...
one more question, hope you dun mind.
if i wanna move to specific place and during moving it will show how it move like an animation rather than just disappear and appear at destination...
is it possible??
thanks,
[no name] 14-Dec-12 2:57am    
Ummm, not sure but Let me try..
lailailaihou 14-Dec-12 2:58am    
thank you very much...
[no name] 14-Dec-12 2:59am    
http://overrider.blogspot.in/2007/07/wpf-moving-controls-in-xyz.html
http://www.c-sharpcorner.com/uploadfile/mahesh/translatetransform-in-wpf/
lailailaihou 14-Dec-12 3:07am    
Wow, thank bro,
i try to search many days already,
but you simply can found it...
thank you very much...

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