1

WPF アプリケーションを作成します。フチなしウィンドウを作りたい。そのために私のコードは次のとおりです

<Window x:Class="AzLeks.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    ResizeMode="CanMinimize" Height="600.586" Width="826.694" WindowStyle="None" AllowsTransparency="False"
    MouseLeftButtonDown="MainWindow_OnMouseLeftButtonDown" Loaded="Window_Loaded"
    WindowStartupLocation="CenterScreen">

<!--<Window.Background>
    <ImageBrush ImageSource="images/bckgr.png" />
</Window.Background>-->
<Window.Resources>
    <Style x:Key="Close" TargetType="Button">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Cursor" Value="Hand" />
                <Setter Property="Background" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>
</Window.Resources>

<Grid Margin="-9,-13,-9,-16" HorizontalAlignment="Center" Background="Transparent" VerticalAlignment="Center" Height="630" Width="845">

    <Grid.RowDefinitions>
        <RowDefinition Height="235*" />
        <RowDefinition />
    </Grid.RowDefinitions>
    <Border CornerRadius="12" BorderBrush="Transparent" BorderThickness="1" >
        <Border.Background>
            <ImageBrush ImageSource="/images/bckgr.png"></ImageBrush>
        </Border.Background>
    </Border>
     <!--Some Content-->
    </Grid>

デザインモードでは、次のように表示されます。 ここに画像の説明を入力

しかし、アプリを実行した後、次のように表示され ここに画像の説明を入力 ました。ここで何が問題なのかわかりません。助けてください、これに対する解決策が見つかりません

4

1 に答える 1

2

このようなもの。

<Window x:Class="AzLeks.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ResizeMode="CanMinimize" Height="600" Width="820" WindowStyle="None" AllowsTransparency="True" Background="Transparent" MouseLeftButtonDown=" MainWindow_OnMouseLeftButtonDown" Loaded="Window_Loaded"     WindowStartupLocation="CenterScreen">

<Window.Resources>
<Style x:Key="Close" TargetType="Button">
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Background" Value="Red" />
        </Trigger>
    </Style.Triggers>
</Style>
</Window.Resources>

<Border CornerRadius="12" BorderBrush="Transparent" BorderThickness="1" >
    <Border.Background>
        <ImageBrush ImageSource="/images/bckgr.png"></ImageBrush>
    </Border.Background>

<Grid HorizontalAlignment="Center" Background="Transparent" VerticalAlignment="Center" >

<Grid.RowDefinitions>
    <RowDefinition Height="235*" />
    <RowDefinition />
</Grid.RowDefinitions>

     <!--Some Content-->
</Grid>
</Border>
于 2016-02-11T07:55:46.917 に答える