且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WebBrowser控件的用户界面

更新时间:2023-12-01 23:46:28

有一些商业应用,在那里,使用这种方法成功。下面是一些注意事项要牢记。这些不应该尝试的方法反正阻止你。要问自己一个重要的问题,虽然是应用程序是否能够成为一个本地网络应用程序来代替。

There are some commercial applications out there that use this approach successfully. The following are some considerations to keep in mind. These shouldn't stop you from attempting the approach anyway. A key question to ask yourself, though, is whether the app could be a native web app instead.

  • Web浏览器控件吃卡。您可以使用Tab键将输入焦点到从托管应用程序的浏览器控件,但你不能选项卡的出路它(除非你code对于显式)

  • The web browser control "eats tabs". You can use the tab key to move the input focus into the browser control from the hosting application, but you cannot tab your way out of it (unless you code for that explicitly)

HTML / JavaScript的应用程序是单线程的。如果您需要任何后台处理,则可能需要委派任务的托管应用程序。

HTML/Javascript apps are single threaded. If you need any background processing, you may need to delegate that task to the hosting app.

如果在Web浏览器控件中出现的错误,他们被视为脚本错误,并包含在控制内。安全壳是一件好事。但是,你甚至可能没有意识到已经在构建/调试时发生错误。

If error conditions occur inside the web browser control, they are treated as script errors, and are contained inside the control. The containment is a good thing. But you might not even realize an error condition has occurred while building/debugging.

如果没有网络连接,用户能看到浏览器的失败页面。你没有得到preempt的,并显示您自己的消息。

If there's no network connectivity, users get to see the browser's failure page. You don't get to preempt that and show your own message.

根据您的应用程序,它是如何实现的,导航看起来较为低迷比在桌面应用程序常用。页面重新加载尤其如此。谨慎使用异步AJAX可以帮助减轻一些的或全部。

Depending on your application and how it is implemented, navigation may seem more sluggish than is common in desktop apps. Page reloads in particular. Careful use of asynchronous AJAX can help alleviate some or all of that.

你的用户会知道他们正在使用的网页。 UI设计本身并不能掩盖这一事实。响应性和偶发故障会披露这一事实。为您这可能会或可能不会成为一个问题。

Your users will know they are working with a web page. UI design alone will not be able to hide that fact. The responsiveness and the occasional failure will disclose that fact. This may or may not be an issue for you.

您的应用程序必须支持多个版本的浏览器。在.NET Web浏览器控件是在互联网浏览器执行用户机器上的包装。这将是IE6,7,8,等等。这取决于什么安装在那里。

Your application will have to support several browser versions. The .NET web browser control is a wrapper around the Internet Explorer implementation on the user's machine. That would be IE6, 7, 8, etc. depending on what's installed there.