<p>I have an owner-drawn UserControl where I've implemented double-buffering.  In order to get double-buffering to work without flicker, I have to override the OnPaintBackground event like so:</p>

<pre><code>protected override void OnPaintBackground(PaintEventArgs e)
{
    // don't even have to do anything else
}
</code></pre>

<p>This works great at runtime.  The problem is that when I have an instance of the control on a form at design time, it becomes a black hole that shows trails of whatever windows are dragged over it (because the override of the OnPaintBackground event also governs design-time appearance).  It's just a cosmetic problem, but it's visually jarring and it always leads new developers on the project to assume something has gone horribly wrong.</p>

<p>Is there any way to have an overridden method like this not be overridden at design time, or is there another solution?</p>

```
```
if (this.DesignMode)
{
    return;    //or call base.OnPaintBackground()
}
```
```