How to block double click in overridden WndProc function in Windows Forms?

后端 未结 5 1701
名媛妹妹
名媛妹妹 2021-01-13 20:00

I have a form created in Windows Forms which is draggable wherever I click. I made it by overriding WndProc function which in turn modifies each click as it was a title bar

5条回答
  •  清酒与你
    2021-01-13 20:34

    In addition to JaredPar I would suggest don not create draggable form in that way, but handle it in 3 steps

    • identify mouse down on the form
    • capture mouse
    • identify mouse up event

    It is not a complicated to handle, and it's better, imo, then disabling a double click on the form.

    For complete example of how you can do that can have a look on

    Creating a Draggable Borderless Form

提交回复
热议问题