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

Code and Documents

Attachment

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 :

photo.jpg

How to Use

 

photo.jpg

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

Comments
Desruelle_luc
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

Bravo. 

Tu as raison. C'est un super partage, comme souvent.

Tu ne penses pas qu'il serait "temps" que NI migre l'objet container .NET de LabVIEW vers -> update the embedded web browser in order to comply with HTML5 ? : Modern embedded web browser

cf un échange récent

Résolu : Modern embedded web browser - NI Community

 

A bientôt

A+

Luc

banniere Luc Livre NXG Champion.png

Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion

MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group

Contributors