Visual Studio XAML Designer无法正确显示窗口的背景图像

时间:2013-07-27 09:29:43

标签: visual-studio-2010 xaml

为什么当我在Microsoft Visual Studio 2010中设计应用程序时,我得到: http://i.imgur.com/Oj52lo9.png

但是当我运行项目时,我得到了:

enter image description here

如何使用“LogIn”删除此框架并修复此框以显示真实设计?

修改


XAML代码:

<Window x:Class="MemsoriaClientApplication.LogIn"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="LogIn" WindowStyle="None" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" FontFamily="Verdana" FontSize="18" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="189" Width="362">
<Window.Background>
    <ImageBrush ImageSource="loginInterface/bg.png"></ImageBrush>
</Window.Background>
<Grid>
    <Label Name="lbl_Title" Content="Aplikacja Memsoria.pl - Logowanie" Opacity="0" FontFamily="Tahoma" FontSize="14" Foreground="#dcdcdc" Margin="6, 5">
        <Label.RenderTransform>
            <ScaleTransform ScaleX="0" ScaleY="0"/>
        </Label.RenderTransform>
        <Label.Triggers>
            <EventTrigger RoutedEvent="Label.Loaded">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource ResourceKey=TitleAnimation}"/>
                </EventTrigger.Actions>
            </EventTrigger>
        </Label.Triggers>
    </Label>
    <Line X1="10" X2="0" Y1="30" Y2="30" Stroke="#e5e5e5" Opacity="0">
        <Line.Triggers>
            <EventTrigger RoutedEvent="Line.Loaded">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource ResourceKey=DrawLine}"/>
                </EventTrigger.Actions>
            </EventTrigger>
        </Line.Triggers>
    </Line>
    <Label Content="NAZWA KONTA:" Foreground="White" FontFamily="Tahoma" FontSize="14" Margin="7,62,-7,-62" />
    <Label Content="HASŁO:" Foreground="White" FontFamily="Tahoma" FontSize="14" Margin="7,97,-7,-62" />
    <TextBox Name="txt_login" Style="{StaticResource ResourceKey=Textbox}" Margin="108,31,-9,66" />
    <PasswordBox Margin="110,77,-7,46" Name="txt_Password" Style="{StaticResource Textbox}" />
    <Button Content="X" Style="{StaticResource ResourceKey=CloseButton}" Height="24" Name="btn_Close" Width="24" Margin="325, -155, 0, 0" Click="btn_Close_Click" />
    <Button Name="btn_LogIn" Content="Zaloguj" Style="{StaticResource ResourceKey=LoginButton}" Margin="0,119,-3,-13" Click="btn_LogIn_Click" />
</Grid>

2 个答案:

答案 0 :(得分:0)

    WindowStyle="None"
    AllowsTransparency="True"

如果这是你想要的,那么会使窗口显示没有边框,

答案 1 :(得分:0)

如果您这样使用,那么您的问题将得到解决。

  WindowStyle="SingleBorderWindow"