# Resizing a response window

For response windows, the size can be set as a percentage of the parent window size. The code must be called in the OnLoaded WHO-method.&#x20;

```csharp
public override void OnLoaded()
{
    base.OnLoaded();

    ResizeWindowBasedOnScreenSize();
}
```

```csharp
private void ResizeWindowBasedOnScreenSize()
{
    var window = WindowContent.FindVisualParent<CustomWindow>();
    if (window == null) return;
    
    WpfScreen.CenterInScreen(window, sizeRatio: 0.8);
}
```

{% hint style="info" %}
&#x20;Note: sizeRatio: 0.8 stands for response size of 80% of the parent window
{% endhint %}

