开发者

DragMove not working when quickly dragging?

开发者 https://www.devze.com 2023-01-29 07:00 出处:网络
I have an application that can moved by dragging the title bar with the typical pattern using DragMove:

I have an application that can moved by dragging the title bar with the typical pattern using DragMove:

private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    DragMove();
}

It works fine, but only if I click in a spot, and then drag. If I click while dragging my mouse over th开发者_C百科e title bar it doesn't move.

Is there another event than MouseLeftButtonDown I need to hook to?


Try calling MyWindow.CaptureMouse() in the MouseLeftButtonDown event handler and then calling MyWindow.ReleaseMouseCapture() in the MouseLeftButtonUp event handler.

0

精彩评论

暂无评论...
验证码 换一张
取 消