2014-02-22 2 views
0

둥근 모서리가있는 간단한 로그인 폼을 만들려고합니다. 아래 양식의 스크린 샷입니다 : 하단에 선분이 있습니다그리드의 아래쪽 가장자리가 테두리를 통해 보이지 않게하는 방법

enter image description here

; 그것은 투명하다. 이 선을 없애기 위해 XAML을 어떻게 바꿀 수 있는지 알려주십시오. -1의 마진을 추가

<Window x:Class="Login" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
Title="Login" WindowStyle="None" AllowsTransparency="True" Background="Transparent" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="194" d:DesignWidth="358" SizeToContent="WidthAndHeight"> 
<Border BorderBrush="#9DE5F5" BorderThickness="4" CornerRadius="8" Width="343"> 
    <Grid Background="#9DE5F5" Width="337" ShowGridLines="False" > 
     <Grid.ColumnDefinitions> 
      <ColumnDefinition Width="108*" /> 
      <ColumnDefinition Width="286*" /> 
     </Grid.ColumnDefinitions> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="*" /> 
      <RowDefinition Height="*" /> 
      <RowDefinition Height="*" /> 
     </Grid.RowDefinitions> 
     <Grid.Resources> 
      <Style TargetType="{x:Type TextBlock}"> 
       <Setter Property="FontSize" Value="16" /> 
       <Setter Property="FontWeight" Value="DemiBold" /> 
       <Setter Property="VerticalAlignment" Value="Center" /> 
       <Setter Property="HorizontalAlignment" Value="Right" /> 
       <Setter Property="Padding" Value="8" /> 
       <Setter Property="Foreground" Value="Black" /> 
      </Style> 
      <Style TargetType="{x:Type TextBox}"> 
       <Setter Property="Margin" Value="5,10,15,5" /> 
       <Setter Property="FontSize" Value="16" /> 
      </Style> 
      <Style TargetType="{x:Type PasswordBox}"> 
       <Setter Property="Margin" Value="5,10,15,5" /> 
       <Setter Property="FontSize" Value="16" /> 
      </Style> 
     </Grid.Resources> 
     <TextBlock Grid.Column="0" Grid.Row="0" >Username:</TextBlock> 
     <TextBlock Grid.Column="0" Grid.Row="1" >Password:</TextBlock> 
     <TextBox Grid.Column="1" Grid.Row="0" Name="txtUserName" Background="White" /> 
     <PasswordBox Grid.Column="1" Grid.Row="1" Name="txtPassword" Background="White" PasswordChar="*" /> 
     <Button Grid.Column="1" Grid.Row="2" HorizontalAlignment="Right" Margin="10,10,15,10" Width="80" FontWeight="Bold" FontSize="13" Background="SteelBlue">Login</Button> 
     <Button Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Margin="10,20,5,10" Width="30" Background="Red" Foreground="White" >X</Button> 
    </Grid> 
</Border> 

답변

0

Border에 4 픽셀 테두리 당신은 단지 그것을 제거해야 Grid과 같은 색이기 때문에.

같은 색상 인 경우 일반적으로 경계에서 실제 배경으로의 전환이 이런 경우에 발생하는 가시적 인 선이 있습니다.

나는 Border 대신 GridBackground을 설정하고 완전히 Border에서 BorderThicknessBorderBrush 속성을 제거하여 문제를 해결할 것입니다.

<Border Background="#9DE5F5" CornerRadius="8" Width="343"> 
    <Grid ShowGridLines="False"> 
    .... 
</Border> 
:-) 내 컴퓨터에 아주 잘 보이는
1

빠른 해킹이지만 없애는 :

여기 내 XAML입니다.

<Grid Background="White" Width="337" ShowGridLines="False" Margin="-1"> 
관련 문제