---
title: "Silverlight application"  
description: "In this tutorial I will tell you, how to create your first Silverlight application with the help of visual studio 2010 IDE.  Prerequisite Visual Studi"  
author: "Anonymous User"  
published: 2011-02-28  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/480/silverlight-application  
category: "silverlight"  
tags: ["silverlight"]  
reading_time: 2 minutes  

---

# Silverlight application

In this tutorial I will tell you, how to create your first Silverlight application with the help of visual studio 2010 IDE.\

##### Prerequisite

- Visual Studio 2010 IDE
- Silverlight 3.0 or 4.0

##### For creating first Silverlight application follow these steps

- Open visual studio 2010.
- Go to File menu followed by New and click it. After performing this step a new project dialog box is open.

![Silverlight application](https://www.mindstick.com/mindstickarticle/e65dd96f-8a75-4b99-b8e3-2d4b95b9543f/images/224e9db7-cfd9-4ae1-af5b-a6d545c16a3d.png)

- From installed template select Silverlight and from project template Silverlight application.
- In name box provide your application name such as FirstSilverLightApplicationDemo and choose the location of your application and then click OK button.

![Silverlight application](https://www.mindstick.com/mindstickarticle/e65dd96f-8a75-4b99-b8e3-2d4b95b9543f/images/05ad247b-0935-4e37-8321-0a303191dc33.png)

- After clicking OK button a new dialog box opens which ask some additional behavior about your application. Don’t change default settings and simply click OK button.

![Silverlight application](https://www.mindstick.com/mindstickarticle/e65dd96f-8a75-4b99-b8e3-2d4b95b9543f/images/bd119f50-b6a5-46fb-b8e8-6288400338a0.png)

- After clicking OK button a new window is open whose name is MainPage.xaml. You have to perform all the activities on this page.
- Every Silverlight application consists of XAML markup code and C# or any .NET language code for implementing behavior.

##### Write down the following code in XAML window

```
<Button Content="Silverlight Application Demo" Height="28" HorizontalAlignment="Left" Margin="68,128,0,0" Name="btnDemo" VerticalAlignment="Top" Width="249" />These code snippets create a Button control. Double click on Button control and code behind file open. Write down following code.private void btnDemo_Click(object sender,  RoutedEventArgs e){            MessageBox.Show("Hello Dear! Welcome to first demonstration of Silverlight Application.");}
```

For executing application press CTRL+F5.

##### Output of the following code snippet is as follows

![Silverlight application](https://www.mindstick.com/mindstickarticle/e65dd96f-8a75-4b99-b8e3-2d4b95b9543f/images/95a94e01-1c95-4a54-9493-e78afc08db30.png)

When user click the button object then a dialog box opens which shows some message to user.

![Silverlight application](https://www.mindstick.com/mindstickarticle/e65dd96f-8a75-4b99-b8e3-2d4b95b9543f/images/dfb95502-ef58-40da-82cc-4056b040631d.png)

\

---

Original Source: https://www.mindstick.com/articles/480/silverlight-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
