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

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

# Window.LocationChanged

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

## LocationChanged

This event gets triggered when window location 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<WindowLocationChangedEventArgs> LocationChanged;
```

Python:

```python
window.LocationChanged += handler  # handler(obj: WindowLocationChangedEventArgs)
```

### Returns

`Action<WindowLocationChangedEventArgs>` — 

### Examples

C#:

```csharp
var window = new Window { Title = "Movable", Width = 300, Height = 200 };
window.LocationChanged += args => Print("Window moved to {0}, {1}", args.Window.Left, args.Window.Top);
window.Show();
```

Python:

```python
def on_start(self):
    window = Window()
    window.Title = "Movable"
    window.LocationChanged += self.on_location_changed
    window.Show()

def on_location_changed(self, args):
    api.Print(f"Window moved to {args.Window.Left}, {args.Window.Top}")
```

