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.
To compile the project you must install the .NET SDK.
In order to compile and execute the program, run the following command:
dotnet run
The yellow part is actually a WinForm component:

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.
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