WPF圓角透明無邊框窗體
阿新 • • 發佈:2018-12-30
<Window x:Class="ImportData.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" Background="{x:Null}" WindowStyle="None" MouseDown="Window_MouseDown" AllowsTransparency="True"> <Grid> <Border CornerRadius="8,8,8,8" Background="Black" Height="Auto"></Border> </Grid> </Window>
窗體移動須加上
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if(e.LeftButton==MouseButtonState.Pressed)
{
DragMove();
}
}
轉自:http://www.cnblogs.com/baobao2010/archive/2012/04/11/2442394.html