【wpf(二)】无边框+资源

无边框

<Window x:Class="WpfApp1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        mc:Ignorable="d"
        WindowStartupLocation="CenterScreen" 
        WindowStyle="None" AllowsTransparency="True" FontSize="30"  Title="主界面" Height="400" Width="800"
        Background="Transparent"
      >
    <Grid>
        <Button Content="按钮01" VerticalAlignment="Top" HorizontalAlignment="left"></Button>
        <Button Content="按钮01" VerticalAlignment="Bottom" HorizontalAlignment="Right"></Button>

    </Grid>
</Window>

第二种 WindowChrome

 <WindowChrome.WindowChrome>
        <WindowChrome CaptionHeight="50">
            
        </WindowChrome>
    </WindowChrome.WindowChrome>

任意形状窗体

 <Window.Clip>
        <PathGeometry Figures="M0,0,200"
    </Window.Clip>

你可能感兴趣的:(c#,开发语言)