---
id: "M:cAlgo.API.Window.Close"
kind: "method"
type: "T:cAlgo.API.Window"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Windows/Window/Close/"
---

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

# Window.Close

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

## Close()

Closes the window

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 void Close()
```

Python:

```python
window.Close() -> None
```

### Examples

C#:

```csharp
var window = new Window { Title = "Confirm", Width = 250, Height = 120 };
var okButton = new Button { Text = "OK" };
okButton.Click += args => window.Close();
window.Child = okButton;
window.Show();
```

Python:

```python
window = Window()
window.Title = "Confirm"
window.Width = 250
window.Height = 120
okButton = Button()
okButton.Text = "OK"
okButton.Click += lambda args: window.Close()
window.Child = okButton
window.Show()
```

