让WPF控制Web浏览器 [英] Make WPF control over the web browser

查看:101
本文介绍了让WPF控制Web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在,我有一个嵌入式Web浏览器控件的WPF应用程序。我想在特定的时间,以显示在Web浏览器的动画,但问题是,WPF控件,当保持在Web浏览器是不可见的。

I have a WPF application in which I have an embedded web browser control. I want to show an animation over the web browser at a certain time, but the problem is that the WPF controls, when kept over the web browser are not visible.

有什么办法来显示我在Web浏览器用户的控制?

Is there any way to show my user control over the web browser?

推荐答案

请回答我这个第一次,

这是Web浏览器控件的 WPF Web浏览器中的控制或 WinForm的 WebBrowser控件托管> WinFormHost

Is this Web Browser control the WPF Web Browser Control or Winform webbrowser control hosted in WinFormHost?

对于任何WPF控件在它显示的动画,你探索...

For any WPF control to show animation over it, did you explore ...


  1. 放置在电网画布控件,然后放置拉伸边框(已在它运行动画)和网格/画布的最后一个子?

  2. 装饰器与不断变化的绘图环境模拟动画?

  3. 透明弹出动画,其静态布局完成(绑定到控件的绝对左,上的立场和实际高度和放大器; width属性)?在控制
  1. Placing your control in Grid or Canvas and then placing an stretched Border (which has running animation in it) as the last child of the grid/canvas?
  2. Adorner with constantly changing drawing context to simulate animations?
  3. Transparent Popup with animation, whose static placement is done (bound to control's absolute left, top positions and actual height & width properties) over the control?

尝试使用Web浏览器控件透明弹出办法...

Try the transparent popup approach for web browser control ...

    <Grid>
        <WebBrowser x:Name="WebBrowser1"/> 
        <Popup IsOpen="{Binding StartAninmation}"
              AllowsTransparency="True"
              Grid.RowSpan="99"
              Grid.ColumnSpan="99"
              Placement="Center"
              Width="{Binding ActualWidth,
                              ElementName=WebBrowser1,
                              Mode=OneWay}"
              Height="{Binding ActualHeight, 
                               ElementName=WebBrowser1,
                               Mode=OneWay}"
              PlacementTarget="{Binding ElementName=WebBrowser1}"
              Opacity="0.5"
              Margin="3">
           <TextBlock Text="Loading ..."/>
       </Popup>
 </Grid>

其中的一个一定会在你的情况下工作。

One of these will surely work in your case.

这篇关于让WPF控制Web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆