简体   繁体   English

如何在浏览器中使用Web浏览器控件?

[英]How to use web browser control in the browser?

I'm trying to load a HTML page via the web browser control in my Silverlight project, but it seems that the content of the control can only be viewed from out-of-browser mode. 我正在尝试通过Silverlight项目中的Web浏览器控件加载HTML页面,但是似乎只能从浏览器外模式查看该控件的内容。

Is there in way to use it in the browser? 是否可以在浏览器中使用它?

Could you give more detail? 您能提供更多细节吗? if you are wanting to control and interact with the WebBrowser Control in the Internet Explorer window, then you can do this. 如果要在Internet Explorer窗口中控制WebBrowser控件并与之交互,则可以执行此操作。 The code will remain the same, except you will need to change your MSHTML DOM reference when declaring your (say) HTML Document, and it'll be declared as an InternetExplorer type (comes up in intellisense after the "As" part if you're using VB, same story with c#). 该代码将保持不变,只不过您在声明(例如)HTML文档时需要更改MSHTML DOM引用,并且将其声明为InternetExplorer类型(如果出现以下情况,则会在intellisense中出现:重新使用VB,与C#相同。

Once you reference this window, you can control it - everything is the same since IE uses the WB control as well, if you however want to use the WB control in your app, you should be able to, give us some more details, are you saying that the content or links are opening up in a new external IE window? 引用此窗口后,就可以对其进行控制-由于IE也使用WB控件,因此所有操作都相同,但是如果您想在应用程序中使用WB控件,则应该能够给我们提供更多详细信息,您是说内容或链接是在新的外部IE窗口中打开的? If that is the case, these things are fixable :). 如果真是这样,那么这些事情是可以解决的:)。

Also, if you're using WPF .NET I think there is a different, less cooler WB control for that than the traditional .NET WB control. 另外,如果您使用的是WPF .NET,我认为与传统的.NET WB控件相比,该控件还有另一个更凉爽的WB控件。 Please elaborate on your question so I can help you further. 请详细说明您的问题,以便我进一步帮助您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM