- See LabVIEW documentation here
- The .NET container supports hosting WinForms controls
- As of 2023, LabVIEW .NET container does not support hosting WPF controls
- Visual Studio 2022
- .NET Framework 4.6.2 SDK
- Microsoft Edge or the Microsoft Edge WebView2 Runtime
- LabVIEW 2020 (32-bit or 64-bit)
- Open
WinFormsApp.sln
with Visual Studio 2022 - The solution requires the
Microsoft.Web.WebView2
nuget package to be installed - You can install the package by selecting
Restore NuGet Packages
on the solution - Build the solution to create the .NET assembly that contains the .NET controls
- The assembly
WinFormsControls.dll
can be found in theWinFormsControls\bin
directory - This assembly is built for
AnyCPU
and can be loaded by both 32-bit and 64-bit LabVIEW
- Open examples/SimpleWinFormControl.vi with LabVIEW 2020 or later
- You will be prompted to locate
WinFormsControls.dll
in the builtWinFormsControls\bin
directory above - The control has public properties and functions
IsChecked
andGetTextBoxValue
- Open examples/WebView2Browser.vi with LabVIEW 2020 or later
- You will be prompted to locate
WinFormsControls.dll
in the builtWinFormsControls\bin
directory above - The example user control
WebView2Control
contains the Microsoft Edge WebView2 control - The control has a public function
Navigate(string url)
- Read Rick Strahl's weblog about the WebView2 control
- Read my post about CefSharp vs WebView2 here