Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to move a listbox from one point to another point with animation using wpf. To change the location of listbox with animation of certain second. I tried PointAnimation, but don't know how to set that to Listbox. If you know please help me in it. Thank you.
Posted
Comments
Nelek 2-Nov-12 8:51am    
What do you mean with animation?

Try two DoubleAnimation, one for the Height and one for the Left. This should be enough to get you going if you already somewhat understand storyboards.
 
Share this answer
 
TranslateTransform trs = new TranslateTransform();
DoubleAnimation anim2 = new DoubleAnimation(0, 0, TimeSpan.FromSeconds(2));
DoubleAnimation anim3 = new DoubleAnimation(0,listbox1.Margin.Left+50, TimeSpan.FromSeconds(2));

trs.BeginAnimation(TranslateTransform.YProperty, anim2);
trs.BeginAnimation(TranslateTransform.XProperty, anim3);
listbox1.RenderTransform = trs;
 
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