Skip to content

mhadikus/winforms-controls

Repository files navigation

Embed .NET Controls on the LabVIEW Front Panel

  • See LabVIEW documentation here
  • The .NET container supports hosting WinForms controls
  • As of 2023, LabVIEW .NET container does not support hosting WPF controls

Requirements

Building the example WinForm controls

  • 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 the WinFormsControls\bin directory
  • This assembly is built for AnyCPU and can be loaded by both 32-bit and 64-bit LabVIEW

Simple WinForms control with a text box and a checkbox

  • Open examples/SimpleWinFormControl.vi with LabVIEW 2020 or later
  • You will be prompted to locate WinFormsControls.dll in the built WinFormsControls\bin directory above
  • The control has public properties and functions IsChecked and GetTextBoxValue

image

image

Chromium web browser

  • Open examples/WebView2Browser.vi with LabVIEW 2020 or later
  • You will be prompted to locate WinFormsControls.dll in the built WinFormsControls\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

image

image

About

Create .NET controls with WinForms and show them on LabVIEW Front Panels

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages