【WPF】WPF无边框、窗体初始化位置与可拖拽窗体的解决方案

https://blog.csdn.net/zjcxhswill/article/details/38646525

 

1、去除边框

WindowStyle="None"   AllowsTransparency="True" 

最好再设置窗体起始位置 WindowStartupLocation="CenterScreen"

2、拖拽

XAML: 
MouseLeftButtonDown="Window_MouseLeftButtonDown_1"

C#:
 private void Window_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
{
            this.DragMove();
}

 

posted @ 2021-05-08 16:50  不溯流光  阅读(201)  评论(0编辑  收藏  举报