1. 程式人生 > >WPF 實現窗體拖動

WPF 實現窗體拖動

mouse down left highlight 窗體拖動 arp sed ons +=

C# 實現代碼

this.Loaded += (r, s) =>
{
    this.MouseDown += (x, y) =>
    {
        if (y.LeftButton == MouseButtonState.Pressed)
        {
            this.DragMove();
        }
    };
};

WPF 實現窗體拖動