# Add a UserControl

{% embed url="<https://youtu.be/DaaW7OnlFdM>" %}

You can use the[ UserControl](https://docs.wisej.com/docs/controls/containers/usercontrol) to create a reusable control for your Wisej.NET application. In our case, we want to be able to navigate between pages of an application. On each page, we want the same navigation menu. So it makes sense to use a UserControl because it can be reused on each page.

To create a UserControl:

In the Solution Explorer, right-click and choose Add->New Item

From the menu that pops up, choose "Wisej.NET 4" and then "User Control". (Alternatively choose Wisej.NET 3 if you are using Wisej.NET 3)

<figure><img src="https://3188166459-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYZg1RIEjJ5H42ECDnFfU%2Fuploads%2FeAy5wrFM8btVwOssOdI1%2Fusercontrol.png?alt=media&#x26;token=13f3df53-34ca-4d5b-90b2-f249afacf89b" alt=""><figcaption></figcaption></figure>

Name your UserControl (Ie "Nagivation.cs") and click "Add"

Add some controls from the toolbox- in our case, we added a combobox and a label. Add some items to the combobox- ie "Page1", "Page2", "Page3".

{% hint style="info" %}
Make sure that you have several pages in your application. You can add new pages by right-clicking on the project in the Solution Explorer and choosing Add -> New Item
{% endhint %}

Attach to the SelectedIndexChanged event of the combobox and add the following code to navigate between pages:

```csharp
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
	switch (comboBox1.SelectedItem)
	{
		case "Page1":
			new Page1().Show();
			break;
		case "Page2":
			new Page2().Show();
			break;
		case "Page3":
			new Page3().Show();
			break;
		default:
			new Page1().Show();
			break;
	}
}
```

Compile the project. Open the designer and you will now see the usercontrol. Click and drag it into the page. Repeat this for each page in the application.
