如何使用 VB.NET 使用 Mozilla ActiveX 控件创建简单的浏览器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21336945/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create simple browser with Mozilla ActiveX Control with VB.NET?
提问by Sinac
I download and install Mozilla ActiveX Control
我下载并安装Mozilla ActiveX 控件
and add MozillaBrowser Classto ToolBox
并添加MozillaBrowser Class到工具箱
Create a windows form application windows, drag drop MozillaBrowserfrom ToolBox to Form1
创建一个 windows 窗体应用程序窗口,MozillaBrowser从 ToolBox拖放到Form1
also drag drop a WebBrowser1to Form1
也拖放一个WebBrowser1到Form1
in Form1_Loadwrite this:
在Form1_Load写这个:
WebBrowser1.ActiveXInstance = AxMozillaBrowser1
but Error Property 'ActiveXInstance' is 'ReadOnly'.
但错误属性“ActiveXInstance”是“只读”。
I want display a fix URL in Mozilla browser, Now I must what to do?
我想在 Mozilla 浏览器中显示一个修复 URL,现在我必须做什么?
回答by Matt Wilko
As I understand it this control is a direct replacementfor the WebBrowser control so you should just add an instance of the control on your form and then something like this should work:
据我了解,此控件是WebBrowser 控件的直接替代品,因此您只需在表单上添加该控件的一个实例,然后这样的操作即可:
AxMozillaBrowser1.Navigate2("http://www.bbc.co.uk")
have a look at this wrapper which may help you on code project: http://www.codeproject.com/Articles/20312/Browsers-Wrapper-Mozilla-IE
看看这个包装器,它可以帮助你进行代码项目:http: //www.codeproject.com/Articles/20312/Browsers-Wrapper-Mozilla-IE

