Textbox

 

 

1、Textbox跟随Grid.Row的变化而变化

        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition Height="40" />
                <RowDefinition Height="*" MinHeight="100"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70" />
                <ColumnDefinition />
                <ColumnDefinition Width="70" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
           
            <!--  内容简介  -->
            <TextBlock
            Grid.Row="1"
            Margin="0,0,5,0"
            HorizontalAlignment="Right"
            Text="内容简介:" />
            <Grid x:Name="myGrid"
              Grid.Row="1"
            Grid.Column="1"
            Grid.ColumnSpan="3">
                <TextBox 
            Width="{Binding Path=ActualWidth,ElementName=myGrid}" 
            Height="{Binding Path=ActualHeight,ElementName=myGrid}"
            VerticalContentAlignment="Top"
            AcceptsReturn="True"
            AcceptsTab="True"
            TextWrapping="Wrap"
            VerticalScrollBarVisibility="Auto"  />
            </Grid>
           
        </Grid>        
View Code

 

posted @ 2019-05-08 14:51  慧由心生  阅读(294)  评论(0编辑  收藏  举报