WPF and Silverlight Edition Basic Library / TabControl / TabControl Quick Start / Step 2 of 4: Adding Tab Pages
Step 2 of 4: Adding Tab Pages

In the last step, you created a WPF or Silverlight project in Visual Studio and then added a C1TabControl control with three tabs to it. In this step, you will customize each tab page.

Complete the following steps:

  1. Switch to XAML view.
  2. Add Header="Tab 1" to the first <c1:C1TabItem> tag so that the markup resembles the following:
XAML
Copy Code
<c1:C1TabItem Header="Tab 1"/>
  1. Add Header="Tab 2" and Content="I am the Content property set to a string" to the second <c1:C1TabItem> tag so that the markup resembles the following:
XAML
Copy Code
<c1:C1TabItem Header="Tab 2" Content="I am the Content property set to a string"/>
  1. Add Header="Tab 3", Content="You can't close this tab. Try it.", and CanUserClose="False" to the third <c1:C1TabItem> tag so that the markup resembles the following:
XAML
Copy Code
<c1:C1TabItem Header="Tab 3" Content="You can't close this tab. Try it." CanUserClose="False"/>

Setting the CanUserClose property to False prevents users from closing the tab at run time.

  1. Add a Calendar control to the first tab by completing the following steps:
    1. Switch to Design view and select the first tab.
    2. In the Toolbox, double-click the Calendar icon to add the Calendar control to the tab.
    3. Select the Calendar control and then set the following properties:
      • Set the Height property to "Auto".
      • Set the Width property to "Auto".

You have completed step 2 of 4. In this step, you customized the three pages of the C1TabControl control. In the next step, you'll customize the appearance and behavior of the C1TabControl control.