在 WP7 中禁用不透明的 WebBrowser 控件
我的应用程序中有一个网络浏览器,只需在没有用户的情况下显示即可。可以与之互动。
因此,如果我设置 IsEnabled = false,浏览器的页面顶部会变成灰色不透明,我不希望这样。
我该怎么办?
谢谢。
i've a webbrowser in my application that only have to show without the user. can interact with it.
So if i set the IsEnabled = false, the browser become with a gray opacity on top of page and i don't want this.
How can i do?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想禁用用户交互,那么您可以尝试:
或
If you want to disable user interactions, then you could try:
or
为了防止在将
IsEnabled
设置为 false 时WebBrowser
控件的不透明度发生变化,您需要为其创建自定义样式。它非常简单,只需如下所示:但是,用户将无法与内容交互。如果您希望控件被禁用但具有交互性,我不确定您想要实现什么目标。如果您试图做的是停止用户与控件交互,那么上面的方法就可以工作,或者将
IsHitTestVisible
设置为 false 将达到相同的结果,但需要更少的时间变化:PTo prevent the opacity change on the
WebBrowser
control when you setIsEnabled
to false you will need to create a custom style for it. It's very simple and need only look like the following:However, the user will not be able to interact with the contents. I'm not sure what you are trying to achieve if you want the control to be disabled but interactive. If what you are trying to do is stop the user interacting with the control, then the above would work, or setting
IsHitTestVisible
to false would achieve the same result, but with fewer changes :P