WPF 不规则界面

MainWindow.xaml

<Window x:Class="iKun.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:iKun"
        mc:Ignorable="d" 
        WindowStyle="None" 
        OpacityMask="White" 
        AllowsTransparency="True" 
        AllowDrop="True" 
        ShowInTaskbar="False">

    <Window.Background>
        <ImageBrush ImageSource="/img1674914398429.png" Stretch="None"/>
    </Window.Background>
</Window>

MainWindow.xaml.cs

using System.Windows;

namespace iKun
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.WindowState = WindowState.Maximized;
            this.Topmost = true;
            InitializeComponent();
        }
    }
}
posted @ 2023-01-28 22:37  talentzemin  阅读(28)  评论(0编辑  收藏  举报