我正在控件中的 WndProc 覆盖中对 WM_PAINT 和 WM_ERASEBKGD 进行自定义处理。
protected override void WndProc(ref Message m)
{
    if (m.Msg == 0xF)
    {
        // [Draw using stored hDC]
        m.Result = (IntPtr)1;
    }
    else if (m.Msg == 0x14)
    {
        m.Result = (IntPtr)1;
    }
    else
        base.WndProc(ref m);
}
它工作得很好,除了它被不断地调用,大约每秒 300 次,如果我允许基地处理它,它会被调用一次。我遗漏了什么?