Click here to Skip to main content
12,241,861 members (52,313 online)
Click here to Skip to main content


202 bookmarked

Don't Flicker! Double Buffer!

, 31 Jan 2006 CPOL
Demonstrates several ways to overcome the annoying flickering problem.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DoubleBufferExample
	public partial class Example : Form
		public Example()

            PaintMethodSelector.SelectedIndex = 0;
            TestMethodSelector.SelectedIndex = 0;
        private void RefreshTimer_Tick(object sender, EventArgs e)

		private void PaintMethodSelector_SelectedIndexChanged(object sender, EventArgs e)
			DoubleBufferControl1.PaintMethod = 
				(DoubleBufferControl.DoubleBufferMethod) PaintMethodSelector.SelectedIndex;

        private void TestMethodSelector_SelectedIndexChanged(object sender, EventArgs e)
            DoubleBufferControl1.GraphicTest =

		private void RefreshInterval_ValueChanged(object sender, EventArgs e)
			RefreshTimer.Interval = (int) RefreshInterval.Value;

        private void StartBtn_Click(object sender, EventArgs e)
            RefreshTimer.Enabled = true;

        private void StopBtn_Click(object sender, EventArgs e)
            RefreshTimer.Enabled = false;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Team Leader
Israel Israel
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 1 Feb 2006
Article Copyright 2006 by Gil.Schmidt
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid