Language

CoreWebView2WindowControlsOverlay.IsEnabled Property

Definition

The IsEnabled property allows you to opt in to using the WebView2 window controls overlay. Defaults to false.

When this property is true, WebView2 will draw its own minimize, maximize, and close buttons on the top right corner of the WebView2.

When using this you should configure your app window to not display its default window control buttons. You are responsible for creating a title bar for your app by using the available space to the left of the controls overlay. In doing so, you can utilize the IsNonClientRegionSupportEnabled API to enable draggable regions for your custom title bar.

The Overlay buttons will cover the HTML content, and will prevent mouse interactions with any elements directly below it, so you should avoid placing content there. To that end, there are four CSS environment variables titlebar-area-x, titlebar-area-y, titlebar-area-width, titlebar-area-height defined to help you get the dimensions of the available titlebar area to the left of the overlay. Similarly the navigator object will contain a WindowControlsOverlay property which can be used to get the titlebar area as a rect, and listen for changes to the size of that area.

public bool IsEnabled { get; set; }
member this.IsEnabled : bool with get, set
Public Property IsEnabled As Boolean

Property Value

Applies to