码迷,mamicode.com
首页 > Windows程序 > 详细

WPF 窗体设置AllowsTransparency=true是 panel视频不能显示

时间:2020-05-26 18:29:22      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:bind   hidden   host   height   parent   binding   row   显示   ica   

 AllowsTransparency=true是加载winform:panel,控件不显示:原因窗体的逻辑和渲染冲突

 

 <WindowsFormsHost  x:Name="wfh"  Grid.Row="1" Grid.Column="1"  Margin="10,30,10,30" Background="Transparent"
                             Width="{Binding ElementName=grid,Path=ActualWidth}"
                              Height="{Binding ElementName=grid,Path=ActualHeight}"
                           Visibility="Hidden">
            <winform:Panel x:Name="Panel_video" Dock="Fill"/>
  </WindowsFormsHost>

 

解决:添加Popup将控件至于顶层  Popup ,并且AllowsTransparency="False"

      <Popup  Grid.Row="2"  Placement="Bottom" Height="190" Width="400"  VerticalOffset="10"  HorizontalOffset="-40" IsOpen="True" StaysOpen="True" AllowsTransparency="False">
                        <WindowsFormsHost  x:Name="wfHost"
                                       Visibility="Visible" Background="#e0e0e0" >
                            <wf:Panel Dock="Fill" BorderStyle="None"/>
                        </WindowsFormsHost>
                    </Popup>
                

WPF 窗体设置AllowsTransparency=true是 panel视频不能显示

标签:bind   hidden   host   height   parent   binding   row   显示   ica   

原文地址:https://www.cnblogs.com/qlbky/p/12966807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!