Silverlight- TabControl Example Part 1

In this article we will be seeing how to create Silverlight TabControl control.



Steps Involved:

Creating a Silverlight Application:

  1. Open Visual Studio 2010.
  2. Go to File => New => Project.
  3. Select Silverlight from the Installed templates and choose the Silverlight Application template.
  4. Enter the Name and choose the location.
  5. Click OK.
  6. In the New Silverlight Application wizard check the "Host the Silverlight Application in a new Web site".
  7. Click OK.

Creating the UI:

Open MainPage.xaml file and replace the code with the following.

    <UserControl xmlns:sdk=""  x:Class="SilverlightTabControl.MainPage"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot">
        <sdk:TabControl  Height="200" Width="200">
            <sdk:TabItem Header="Orange">
                <StackPanel Background="Orange">
            <sdk:TabItem Header="White">
                <StackPanel Background="White">
            <sdk:TabItem Header="Green">
                <StackPanel Background="Green">


Similar Articles