Share via


WebView2.DefaultBackgroundColor Property

Definition

Gets or sets the color to use as the WebView2 background when the HTML content does not specify a color.

public:
 property Color DefaultBackgroundColor { Color get(); void set(Color value); };
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
Color DefaultBackgroundColor();

void DefaultBackgroundColor(Color value);
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
public Color DefaultBackgroundColor { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")] set; }
var color = webView2.defaultBackgroundColor;
webView2.defaultBackgroundColor = color;
Public Property DefaultBackgroundColor As Color
<WebView DefaultBackgroundColor="predefinedColorName"/>
- or -
<WebView DefaultBackgroundColor="#rgb"/>
- or -
<WebView DefaultBackgroundColor="#argb"/>
- or -
<WebView DefaultBackgroundColor="#rrggbb"/>
- or -
<WebView DefaultBackgroundColor="#aarrggbb"/>
- or -
<WebView DefaultBackgroundColor="sc#scR,scG,scB"/>
- or -
<WebView DefaultBackgroundColor="sc#scA,scR,scG,scB"/>

Property Value

The background color.

Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

Applies to