Wpf窗口设置可拖动

在窗口界面的一个控件(TopGrid)设置如下MouseLeftButtonDown事件即可

private void TopGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                this.DragMove();
            }
            catch { }
        }
posted @ 2018-03-06 18:34  程序猿kid  阅读(852)  评论(0编辑  收藏  举报