2010-08-12 69 views

回答

1

繪製佈局(網格,帆布等),從而使一個或多個細胞中含有的禁區。然後在該特定區域上繪製矩形或邊框控件以獲得所需的效果。請記住首先添加Rectangle,或者像下面展示的那樣使用ZIndex播放,這樣您的代碼就不會隱藏任何控件。

<Grid> 
    <Grid.RowDefinitions> 
     <RowDefinition/> 
     <RowDefinition/> 
    </Grid.RowDefinitions> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition/> 
     <ColumnDefinition/> 
    </Grid.ColumnDefinitions> 
    <Rectangle Grid.Column="0" Grid.Row="1" Panel.ZIndex="0" > 
     <Rectangle.Style> 
      <Style TargetType="{x:Type Rectangle}"> 
       <Setter Property="Fill" Value="Blue"/> 
      </Style> 
     </Rectangle.Style> 
    </Rectangle > 
    <TextBox Grid.Column="0" Grid.Row="1" Height="25" Margin="10" Text="Test 123" Panel.ZIndex="1" /> 
</Grid>