# Adding Multiple Controls to the Content Panel

## Content

You cannot set the **Content** property to more than one control at a time. However, you can circumvent this issue by adding a panel-based control that can accept more than one control, such as a **StackPanel** control, to the content panel of [C1HeaderedContentControl](/componentone/api/wpf/online-basiclibrary/dotnet-framework-api/C1.WPF.4.6.2/C1.WPF.C1HeaderedContentControl.html). When you add multiple controls to the panel-based control, each one will appear within the **C1HeaderedContentControl**'s content panel.
**In XAML**
To add a button control to the **C1HeaderedContentControl**'s content panel in XAML, complete the following steps:

1. Place the following XAML markup between the `<c1:C1HeaderedContentControl>` and `</c1:C1HeaderedContentControl>` tags:

    ```xml
    <c1:C1HeaderedContentControl.Content>
       <StackPanel>
         <TextBlock Text="1st TextBlock"/>
         <TextBlock Text="2nd TextBlock"/>
         <TextBlock Text="3rd TextBlock"/>
       </StackPanel>
    </c1:C1HeaderedContentControl.Content>
    ```
2. Run the program.
3. Expand **C1HeaderedContentControl** and observe that each of the three **TextBlock** controls appear in the content panel.

**In Code**
To add multiple controls to the content panel, complete these steps:

1. Enter Code view and add the following code beneath the **InitializeComponent()** method:
<br>
    DOC-DETAILS-TAG-OPEN
<br>
    DOC-SUMMARY-TAG-OPEN
<br>
    Visual Basic
<br>
    DOC-SUMMARY-TAG-CLOSE

    ```vbnet
    'Create a stack panel and add it to C1HeaderedContentControl
    Dim StackPanel1 As New StackPanel()
    C1HeaderedContentControl_CP.Content = (StackPanel1)
    'Create three TextBlock control and set their Text properties
    
    Dim TextBlock1 As New TextBlock()
    Dim TextBlock2 As New TextBlock()
    Dim TextBlock3 As New TextBlock()
    TextBlock1.Text = "1st TextBlock"
    TextBlock2.Text = "2nd TextBlock"
    TextBlock3.Text = "3rd TextBlock"
    'Add TextBlock controls to StackPanel
    
    StackPanel1.Children.Add(TextBlock1)
    StackPanel1.Children.Add(TextBlock2)
    StackPanel1.Children.Add(TextBlock3)
    ```

    DOC-DETAILS-TAG-CLOSE
<br>
    DOC-DETAILS-TAG-OPEN
<br>
    DOC-SUMMARY-TAG-OPEN
<br>
    C#
<br>
    DOC-SUMMARY-TAG-CLOSE

    ```csharp
    //Create a stack panel and add it to C1HeaderedContentControl
    
    StackPanel StackPanel1 = new StackPanel();
    C1HeaderedContentControl_CP.Content = (StackPanel1);
    //Create three TextBlock control and set their Text properties
    
    TextBlock TextBlock1 = new TextBlock();
    TextBlock TextBlock2 = new TextBlock();
    TextBlock TextBlock3 = new TextBlock();
    TextBlock1.Text = "1st TextBlock";
    TextBlock2.Text = "2nd TextBlock";
    TextBlock3.Text = "3rd TextBlock";
    //Add TextBlock controls to StackPanel
    
    StackPanel1.Children.Add(TextBlock1);
    StackPanel1.Children.Add(TextBlock2);
    StackPanel1.Children.Add(TextBlock3);
    ```

    DOC-DETAILS-TAG-CLOSE
2. Run the program.
3. Expand the **C1HeaderedContentControl** and observe that each of the three **TextBlock** controls appear in the content panel.

**This Topic Illustrates the Following**:
When **C1HeaderedContentControl** is expanded, three **TextBlock** controls will appear in the content panel as follows:
![C1WPF Basic Library - HeaderedContentControl Multiple Buttons in content panel](https://cdn.mescius.io/document-site-files/images/7e9deccd-1f1c-4ec7-af90-b4332b45dead/images/headercontentcontrol/multiplecontrolsincontent.png)