---
id: "E:cAlgo.API.Window.SizeChanged"
kind: "event"
type: "T:cAlgo.API.Window"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Windows/Window/SizeChanged/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Window.SizeChanged

Member of [Window](https://help.ctrader.com/ctrader-algo/references/Controls/Windows/Window/index.md).

## SizeChanged

This event gets triggered when window is size changes

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.
- Cloud: Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.

C#:

```csharp
public event Action<WindowSizeChangedEventArgs> SizeChanged;
```

Python:

```python
window.SizeChanged += handler  # handler(obj: WindowSizeChangedEventArgs)
```

### Returns

`Action<WindowSizeChangedEventArgs>` — 

### Examples

C#:

```csharp
var window = new Window { Title = "Resizable", Width = 300, Height = 200 };
window.SizeChanged += args => Print("Window size: {0}x{1}", args.Window.Width, args.Window.Height);
window.Show();
```

Python:

```python
def on_start(self):
    window = Window()
    window.Title = "Resizable"
    window.SizeChanged += self.on_size_changed
    window.Show()

def on_size_changed(self, args):
    api.Print(f"Window size: {args.Window.Width}x{args.Window.Height}")
```

