你的位置:首页 > ASP.net教程

[ASP.net教程]WPF系列:无边框窗口


<Window x:Class="Ares.Animations.Window3"    ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    ="http://schemas.microsoft.com/winfx/2006/xaml"    Title="Window3" Height="300" Width="300" WindowStyle="None" Background="{x:Null}" AllowsTransparency="True" >  <DockPanel Background="BlueViolet">    <Border Height="30" Background="BlueViolet" DockPanel.Dock="Top" MouseLeftButtonDown="Window_MouseLeftButtonDown">      <Grid>        <Grid.ColumnDefinitions>          <ColumnDefinition/>          <ColumnDefinition/>        </Grid.ColumnDefinitions>        <TextBlock FontSize="18">无边框窗口</TextBlock>        <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">          <Rectangle Width="30" Height="30" Fill="Red" Stroke="Black" StrokeThickness="2"></Rectangle>          <Rectangle Width="30" Height="30" Fill="Red" Stroke="Black" StrokeThickness="2"></Rectangle>          <Rectangle Width="30" Height="30" Fill="Red" Stroke="Black" StrokeThickness="2" MouseDown="Rectangle_MouseDown"></Rectangle>        </StackPanel>      </Grid>    </Border>    <Border Background="WhiteSmoke" >      <TextBlock>Center</TextBlock>    </Border>  </DockPanel></Window>