Language

CoreWebView2Controller.Bounds Property

Definition

Gets or sets the WebView bounds.

public System.Windows.Rect Bounds { get; set; }
public System.Drawing.Rectangle Bounds { get; set; }
member this.Bounds : System.Windows.Rect with get, set
member this.Bounds : System.Drawing.Rectangle with get, set
Public Property Bounds As Rect
Public Property Bounds As Rectangle

Property Value

Remarks

Bounds are relative to the ParentWindow. The app has two ways to position a WebView:

  • Create a child HWND that is the WebView parent HWND. Position the window where the WebView should be. Use (0, 0) for the top-left corner (the offset) of the Bounds of the WebView.
  • Use the top-most window of the app as the WebView parent HWND. Position the WebView in the app by setting the top-left corner of the Bounds of the WebView to the desired offset in the parent window.

The values of Bounds are limited by the coordinate space of the host.

Applies to