How to set webview2 DefaultBackgroundColor in a Win32 project?

Vishnu Gopalakrishnan 126 Reputation points
2023-04-12T02:06:43.1033333+00:00

I am using WebView2 in an OCX. I wish to add the default background color for the webview2 to avoid the initial flickering. I tried this https://github.com/MicrosoftEdge/WebView2Feedback/issues/1621 But didn't work. Looking forward to hear the answers. Also, I didn't see a method to set CoreWebView2Controller.DefaultBackgroundColor Property in win32.

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,179 questions
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,834 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,452 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xiaopo Yang - MSFT 11,581 Reputation points Microsoft Vendor
    2023-04-13T02:14:39.77+00:00