我想在Windows窗体中加载Web浏览器

编程入门 行业动态 更新时间:2024-10-28 16:24:24
本文介绍了我想在Windows窗体中加载Web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有三个名为IE,Chrome和Firefox的按钮。单击这些按钮,我需要打开相关的浏览器,并且应该在窗体内打开。

解决方案

您无法将应用程序嵌入到表单中。对于浏览器,我假设您要使用的是将html转换为可见文档的渲染引擎。 IE将其渲染引擎公开为一个ActiveX控件,您可以轻松地将其嵌入到表单中,因为Microsoft非常喜欢这样。对于Chrome或Firefox,您必须找到一种嵌入各自引擎的方法,即Blink和Gecko,但这些引擎会随着时间和版本的变化而变化。所以谷歌如何嵌入Blink以及如何嵌入Gecko,但这可能不太容易。

尝试使用System.Windows.Forms.WebBrowser-Control for IE。

I have three buttons in form named IE, Chrome & Firefox. On click of these button, i need to open concerned browsers and that should be opened inside form.

解决方案

You can't embed applications into your form. For browsers I assume what you want to use is the rendering engine that turns html into a visible document. IE exposes its rendering engine as an ActiveX control that you can easily embed into your form because Microsoft are nice like that. For Chrome or Firefox you'd have to find a way of embedding their respective engines which are Blink and Gecko, however these change over time and versions. So google for how to embed Blink and how to embed Gecko, however it might not be easily possible.

Try using the System.Windows.Forms.WebBrowser-Control for IE.

更多推荐

我想在Windows窗体中加载Web浏览器

本文发布于:2023-11-09 16:16:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572834.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我想   窗体   加载   浏览器   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!