Are System.Windows.Forms supported in WebView2?

Priyanka Songra 6 Reputation points
2022-03-06T18:16:27.867+00:00

We have a VSTO addin for MS Project 2010/2013/2016/2019, where it imports/exports data from an external application and these pages are rendered in embedded Internet Explorer browser from MS Project.
Since IE support will be ending in few years, we are moving to new embedded browser control known as the Microsoft Edge WebView2 control.
To display pages using embedded IE, our application uses System.Windows.Forms. Now as we want to switch to WebView2 control, will these System.Windows.Forms continue to work with WebView2 or do we need to convert these forms into Microsoft.Web.WebView2.WinForms?

Any help would be highly appreciated.

Thanks,
Priyanka

Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
381 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,596 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,861 Reputation points
    2022-03-06T18:58:04.54+00:00

    WebView2 works without problem in WinForms (once the Runtime has been installed)
    You can see Get started with WebView2 in WinForms apps

    0 comments No comments

  2. Priyanka Songra 6 Reputation points
    2022-03-07T06:36:35.12+00:00

    Thanks @Castorix31 for your response.

    Our application uses System.Windows.Forms at present. On switching to WebView2, will these Windows.Forms render in WebView2 without any problem or we need to use Microsoft.Web.WebView2.WinForms instead of System.Windows.Forms?
    In short , is WebView2 backward compatible with System.Windows.Forms?

    Thanks,
    Priyanka