Example Code

Use Internet Explorer 11 as Webbrowser on a LabVIEW UI

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Programming Language

  • LabVIEW G

Description

 

LabVIEW provides a WebBrowser control. It is a .NET control that contains an embedded Internet Explorer control. An example is provided here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YKVvCAO&l=fr-CH

But infortunately, when a WebBrowser is called, Internet Explorer use Internet Explorer 7 engine to render the website. This is not usable to display a modern Website with HTML5 stuff. 

 

To render correctly a modern Website, we have to coerce Internet Explorer to use Internet Explorer 11 engine. It is possible to do that using Windows registers. This example modifies HK_Current_User. To Enable IE11 mode, we have to write the application name (.exe file) in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION. In developement mode, it will be Labview.exe. 

More informations from Microsoft here : https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-in...

 

This example VI writes in register. You have to restart once to take effect.

 

Without Internet Explorer 11 emulation (IE7):

photo.jpg

 

With Internet Explorer 11 emulation :

How to Use

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.