问题描述
我在,我有一个嵌入式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 ...
- 放置在
电网
或画布
控件,然后放置拉伸边框
(已在它运行动画)和网格/画布的最后一个子? -
装饰器
与不断变化的绘图环境模拟动画? - 透明
弹出
动画,其静态布局完成(绑定到控件的绝对左,上的立场和实际高度和放大器; width属性)?在控制李>
- Placing your control in
Grid
orCanvas
and then placing an stretchedBorder
(which has running animation in it) as the last child of the grid/canvas? Adorner
with constantly changing drawing context to simulate animations?- 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浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!