Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi.....how to set the animations to controls except slide,roll,Blend,centre.
actually i have a panel which is invisible at first in my application,when i click on a button it must comes from some point and visible at some another point on the form and the flying effect must visible when panel moves on the form.....
Any Idea
Posted

1 solution

You have to do it yourself. Create an animation thread. It should be some sequence of changes in a loop where you change one more of the control's property. Start this thread to start animation. Now, how can you work with the UI thread using this thread? You cannot call anything related to UI from non-UI thread. Instead, you need to use the method Invoke or BeginInvoke of System.Windows.Threading.Dispatcher (for both Forms or WPF) or System.Windows.Forms.Control (Forms only).

You will find detailed explanation of how it works and code samples in my past answers:
Control.Invoke() vs. Control.BeginInvoke()[^],
Problem with Treeview Scanner And MD5[^].

See also more references on threading:
How to get a keydown event to operate on a different thread in vb.net[^],
Control events not firing after enable disable + multithreading[^].

If you also want to animate some graphics rendered in some controls, please see my past answers:
How to speed up my vb.net application?[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
capture the drawing on a panel[^],
Drawing Lines between mdi child forms[^].

—SA
 
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