# C1.Win.Themes.C1ThemeController.ApplyThemeToControlTree

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Themes_C1ThemeController_ApplyThemeToControlTree_" data-uid="C1.Win.Themes.C1ThemeController.ApplyThemeToControlTree*">ApplyThemeToControlTree Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Themes_C1ThemeController_ApplyThemeToControlTree_" data-uid="C1.Win.Themes.C1ThemeController.ApplyThemeToControlTree*"></a>
<h4 id="C1_Win_Themes_C1ThemeController_ApplyThemeToControlTree_System_Windows_Forms_Control_C1_Win_Themes_C1Theme_System_Predicate_System_Windows_Forms_Control__System_Boolean_" data-uid="C1.Win.Themes.C1ThemeController.ApplyThemeToControlTree(System.Windows.Forms.Control,C1.Win.Themes.C1Theme,System.Predicate{System.Windows.Forms.Control},System.Boolean)">ApplyThemeToControlTree(Control, C1Theme, Predicate&lt;Control&gt;, bool)</h4>
<div class="markdown level1 summary"><p>Recursively applies a theme to a control and its children.
Controls that do not support themes are ignored (but the theme is applied to their children).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void ApplyThemeToControlTree(Control root, C1Theme theme, Predicate&lt;Control&gt; applyThemeToSubTree = null, bool applyToChildren = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub ApplyThemeToControlTree(root As Control, theme As C1Theme, Optional applyThemeToSubTree As Predicate(Of Control) = Nothing, Optional applyToChildren As Boolean = False)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control">Control</a></td>
      <td><span class="parametername">root</span></td>
      <td><p>The root control to apply the theme to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Win.Themes.C1Theme.html">C1Theme</a></td>
      <td><span class="parametername">theme</span></td>
      <td><p>The theme to apply.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control">Control</a>&gt;</td>
      <td><span class="parametername">applyThemeToSubTree</span></td>
      <td><p>Predicate which, if specified,
allows to break theme application on certain nodes in the tree if it returns false.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">applyToChildren</span></td>
      <td><p>If true, applies the theme to children regardless of whether the theme has been applied to the parent.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
