Imagine you want to animate some object on a WinForm. You setup a timer to update the state or model, and override the paint event of the Form. But from there, what's the best way to continually repaint the Form for the animation?
- Invalidate the Form as soon as you are done drawing?
- Setup a second timer and invalidate the form on a regular interval?
- Perhaps there is a common pattern for this thing?
- Are there any useful .NET classes to help out?
Each time I need to do this I discover a new method with a new drawback. What are the experiences and recommendations from the SO community?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…