MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Add CornerRadius support

Open
#2,935 2 comments 6 reactions 1 assignee View on GitHub

@Lakshmisha-KS is already working on this.

Since Feb 12, 2025.

feature request tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Add CornerRadius support

Related to CornerRadius support #1509

The current problem

CornerRadius support is something me and a lot of other users have been frustrated about not existing when using WebView2 (See examples: jeryshn's comment - Microsoft.Web.WebView2.Wpf doesn't support transparency #328 and Stackoverflow - How to set the corner radius of webview2 in WPF Window).

Alternative solutions

I have tried numerous other solutions which all lead to an undesired result;

1. Using WindowChrome to create rounded corners on the Window

This solution produces rounded corners which does round out WebView2's corners, however this only applies if WebView2 is maximized and also produces jaggy corners.

<WindowChrome.WindowChrome>
    <WindowChrome 
    ResizeBorderThickness="5"
    CornerRadius="16,16,16,16"
    GlassFrameThickness="0" />
</WindowChrome.WindowChrome>

Example of jaggy corners
image

2. Using AllowTransparency="true" on Window using a border element to round corners

As WebView2 is natively wrapped on the Window it only overlaps the rounded corners created by the border element as shown below.

<Grid Focusable="True">
    <Border Background="#FFDE8E3D" CornerRadius="16,16,16,16">
        <Wpf:WebView2 x:Name="WebRenderer" Source="FILEPATH" Margin="0,0,36,19"/>
    </Border>
</Grid>

image

Feature request

This is a feature I believe should be an essential component to WebView2 (especially given its natively wrapped onto the Window). I should be able to simply use a property named "CornerRadius" which works the exact same way WPF has already implimented this property on their other elements (e.g Borders).

Thank you for taking your time.

AB#42189078

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.