# C1.Win.Themes.C1ThemeController.GetThemeByName

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Themes_C1ThemeController_GetThemeByName_" data-uid="C1.Win.Themes.C1ThemeController.GetThemeByName*">GetThemeByName Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Themes_C1ThemeController_GetThemeByName_" data-uid="C1.Win.Themes.C1ThemeController.GetThemeByName*"></a>
<h4 id="C1_Win_Themes_C1ThemeController_GetThemeByName_System_String_System_Boolean_" data-uid="C1.Win.Themes.C1ThemeController.GetThemeByName(System.String,System.Boolean)">GetThemeByName(string, bool)</h4>
<div class="markdown level1 summary"><p>Retrieves a theme registered with the application, by its name.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static C1Theme GetThemeByName(string themeName, bool throwException)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetThemeByName(themeName As String, throwException As Boolean) As C1Theme</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.string">string</a></td>
      <td><span class="parametername">themeName</span></td>
      <td><p>The name of the theme to get.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">throwException</span></td>
      <td><p>Indicates whether an exception should be thrown if the specified theme cannot be found.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Win.Themes.C1Theme.html">C1Theme</a></td>
      <td><p>The theme with the specified name, or null if a matching theme could not be found
while <code class="paramref">throwException</code> is false.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
