Vamsi
Vamsi

Reputation: 4253

How to animate a winforms custom control in C# without flickering?

I am looking for some help on how to animate a winforms custom control, the animations are simple fade-in fadeout or something a like an accordion style animation.

Can you please suggest any articles or code related to this.

Upvotes: 2

Views: 2038

Answers (2)

RvdK
RvdK

Reputation: 19790

It's called the DoubleBuffer property (MS documentation).

Here's an example.

Upvotes: 5

Tim Barrass
Tim Barrass

Reputation: 4939

Yep, use DoubleBuffer. A couple of tips I remember picking up:

  • Don't do anything other than copy a back buffer to the control in the control's paint method.

  • Handle refresh of the control in an independent thread.

  • Don't call refresh from any event handlers that modify the control! :)

Upvotes: 2

Related Questions