# Closing

The **RadWindow** can be closed by either clicking on its 'Close' button at the top-right corner or by calling the **Close()** method of the **RadWindow** instance.

![WPF RadWindow Close Button](https://www.telerik.com/products/wpf/documentation/assets/3ab58cab2b2cccacda2e3895ba25f837/radwindow_features_closing_01.png)

**Example 1: Closing a RadWindow**

```C#
RadWindow radWindow = new RadWindow();
radWindow.Show();
//...
radWindow.Close();
```

```VB.NET
	Dim radWindow As New RadWindow()
	radWindow.Show()
	'...'
	radWindow.Close()
```

> tip When the **RadWindow** gets closed, the **Closed** event is raised. More about events can be found [here](https://www.telerik.com/products/wpf/documentation/controls/radwindow/events-overview).

## Prevent Closing

To disable the closing of the **RadWindow** via the UI you can set the **CanClose** property to **False**.

**Example 2: Setting the CanClose property**

```C#
RadWindow radWindow = new RadWindow();
radWindow.CanClose = false;
```

```VB.NET
	Dim radWindow As New RadWindow()
	radWindow.CanClose = False
```

![WPF RadWindow Hidden Close Button](https://www.telerik.com/products/wpf/documentation/assets/f42de09b4fb717c0a9c1a05ac7572909/radwindow_features_closing_02.png)

Alternatively, you can also handle the **PreviewClosed** event and set the **Cancel** property of the event arguments to True.

**Example 3: Canceling the PreviewClosed event**

```C#
private void RadWindow_PreviewClosed(object sender, WindowPreviewClosedEventArgs e)
{
    e.Cancel = true;
}
```

```VB.NET
	Private Sub RadWindow_PreviewClosed(ByVal sender As Object, ByVal e As WindowPreviewClosedEventArgs)
		e.Cancel = True
	End Sub
```

## See Also

* [Moving](https://www.telerik.com/products/wpf/documentation/controls/radwindow/features/moving)

* [Minimizing/Maximizing](https://www.telerik.com/products/wpf/documentation/controls/radwindow/features/minimizingmaximazing)

* [Resizing](https://www.telerik.com/products/wpf/documentation/controls/radwindow/features/resizing)
