Skip to content

axis68/WinFormOverWebView2

Repository files navigation

Winform over WebView2

This project demonstrates how a WinForms component can be integrated into an HTML5 page rendered by WebView2. The WinForms component is displayed on top of the WebView2 control, having its position and size continuously synchronized to match the corresponding HTML element.

Prerequisites

To compile the project you must install the .NET SDK.

Execute the program

In order to compile and execute the program, run the following command:

dotnet run

Screenshot

The yellow part is actually a WinForm component: screenshot

Visual Studio Code setup

The program has been developed with Visual Studio Code.

Following extensions are needed: C# Dev Kit and NET Install Tool extensions from the VS Code Marketplace.

The page Getting Started with C# in VS Code was helpful for me.

How the project was created?

The following command creates a new .NET project with a winform:

dotnet new winforms -n WebView2WinFormsDemo -f net10.0

Then the nuget package WebView2 gets installed with the following command:

dotnet add package Microsoft.Web.WebView2

About

A demo integrating WinForm in WebView2 HTML5 content

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published