# Setting focus to RadChat on load

## Environment

<table>
	<tr>
		<th scope="row">Product Version</th>
		<td>2019.1.220</td>
	</tr>
	<tr>
		<th scope="row">Product</th>
		<td>RadChat for WPF</td>
	</tr>
</table>

## Description

How to set focus to RadChat on load.

## Solution

Access the **RadWatermarkTextBox** inside the RadChat, using the [ChildrenOfType](https://www.telerik.com/products/wpf/documentation/common-information/common-visual-tree-helpers) extension method and focus it. This can be achieved in the **Loaded** event of the control.

```XAML
	<telerik:RadChat x:Name="chat" Loaded="chat_Loaded" />
```

```C#
	private void chat_Loaded(object sender, RoutedEventArgs e)
    {
        var chat = sender as RadChat;
        var watermarkTextBox = chat.ChildrenOfType<RadWatermarkTextBox>().FirstOrDefault(tb => tb.Name == "PART_InputBox");
        watermarkTextBox.Focus();
    }
```
