Double Buffering UserControl di C#

Posted: January 25, 2009 in C#, Programming
Tags: ,

Pastinya komponen UserControl akan berkedap-kedip ketika kita memanggil fungsi Refresh(). Nah,cara mengakalinya ternyata cukup gampang, kita tinggal menambah beberapa baris kode dibawah ini di konstruktor.

this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.DoubleBuffer,true);

That’s All, hasilnya, tampilan animasi akan mulus tanpa kedap-kedip.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s