【发布时间】:2022-01-16 17:08:05
【问题描述】:
我创建了一个 WPF 项目,我需要在其中显示两个 StackPanels,如下所示:
此屏幕是主网格的子屏幕
StackPanel 1 将在不改变宽度和高度的情况下显示,我需要在前一个 StackPanel 之上显示整个第二个 StackPanel。在这种情况下,使用 Canvas 和 DockPanel 对我没有帮助。
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel VerticalAlignment="Center" Grid.Row="0" x:Name="web1">
<wv2:WebView2 Name="MyWebView"
Height="800" >
</wv2:WebView2>
</StackPanel>
<StackPanel Grid.Row="0" x:Name="videoPlayerPanel">
<Canvas >
<local:VideoPlayer x:Name="videoPlayer" Background="AntiqueWhite"/>
</Canvas>
</StackPanel>
</Grid>
【问题讨论】:
-
请点击WPF覆盖查看图片
标签: c# .net wpf xaml stackpanel