0

ユーザーがウィンドウ内の任意の場所をクリックし、マウスを押したままドラッグすると、ウィンドウを移動可能にしようとしています。逆に、ユーザーがマウスの位置を一定に保ちながらマウスを押して離すと、ウィンドウ内にあるものは何でもクリックされます。基本的に、それはその中またはその上のどこからでもドラッグできるツールバーです。

問題は、DragMove() がマウスの状態をリリースに変更し、ウィンドウがドラッグされていないときにプレス アンド リリースを受け取るには、ウィンドウ内にあるものをすべて必要とすることです。

private void currentWindow_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
        double tempX = currentWindow.Left;
        double tempY = currentWindow.Top;
        this.DragMove();
        if (currentWindow.Left == tempX && currentWindow.Top == tempY)
        {
            // at this point e.ButtonState is Released but I need it to be Pressed!
            // some code here to press the button
        }
}
4

0 に答える 0