📜  c# 将鼠标事件传递给父级 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:07.501000             🧑  作者: Mango

代码示例1
//Create a control inherited from Label and add the following code.
protected override void WndProc(ref Message m)
{
    const int WM_NCHITTEST = 0x0084;
    const int HTTRANSPARENT = (-1);

    if (m.Msg == WM_NCHITTEST)
    {
        m.Result = (IntPtr)HTTRANSPARENT;
    }
    else
    {
        base.WndProc(ref m);
    }
}