2013-07-27 45 views
0

爲什麼當我在Microsoft Visual Studio 2010設計一個應用程序,我得到: http://i.imgur.com/Oj52lo9.pngVisual Studio的XAML設計器顯示不正確窗口的背景圖像

但是當我運行的項目,我得到:

enter image description here

如何使用「登錄」刪除此框架並修復此問題以顯示真實設計?

編輯


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> 

+0

你能分享XAML代碼嗎? –

+0

添加了XAML代碼。我已經完成了這個窗口,但仍然有這個問題。 –

回答

0
WindowStyle="None" 
    AllowsTransparency="True" 

會使窗口出現,沒有邊界,如果這是你想要的,

0

如果你這樣使用,那麼你的問題將得到解決。

WindowStyle="SingleBorderWindow" 
+0

但我的風格必須是無。 –

+0

爲此,您必須添加一個自定義標題欄。 在標籤「lbl_Title」前面添加一個帶有文本塊的邊框。 將Text =「LogIn」賦予文本塊 – Punam