我不知道如何在WPF
. 这是我的代码:
<ScrollViewer Grid.Row="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" HorizontalAlignment="Left" Margin="10,5,0,0" Width="500">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.Background >
<ImageBrush ImageSource="Public\Images\chat_green-textarea.png"/>
</Grid.Background>
<TextBlock Padding="5" Foreground="White" FontSize="15" TextWrapping="Wrap">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</TextBlock>
</Grid>
<Grid Grid.Row ="1">
<Image Source="Public\Images\chat_green-textarea-tail.png" Height="20" Width="30" HorizontalAlignment="Left" Margin="10,-4,0,0"/>
</Grid>
</Grid>
</Grid>
</ScrollViewer>
我在 aText
中显示 a Grid
,但我希望将其最大宽度设置为等于其父网格的 75%。谢谢!