# C1.Win.C1Editor.C1TextRange.RemoveStyle

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_C1Editor_C1TextRange_RemoveStyle_" data-uid="C1.Win.C1Editor.C1TextRange.RemoveStyle*">RemoveStyle Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_C1Editor_C1TextRange_RemoveStyle_" data-uid="C1.Win.C1Editor.C1TextRange.RemoveStyle*"></a>
<h4 id="C1_Win_C1Editor_C1TextRange_RemoveStyle_System_String_System_String_" data-uid="C1.Win.C1Editor.C1TextRange.RemoveStyle(System.String,System.String)">RemoveStyle(string, string)</h4>
<div class="markdown level1 summary"><p>Removes the specified inline style.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void RemoveStyle(string propertyName, string propertyValue)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub RemoveStyle(propertyName As String, propertyValue As String)</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">propertyName</span></td>
      <td><p>Name of the inline style.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">propertyValue</span></td>
      <td><p>CSS value of the inline style.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_C1Editor_C1TextRange_RemoveStyle_System_String_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>If <code class="paramref">propertyValue</code> is null, the function removes specified inline style with any value.</p>
</div>
<h5 id="C1_Win_C1Editor_C1TextRange_RemoveStyle_System_String_System_String__examples">Examples</h5>
<p>This example removes specified color from the selected text.
If the value is null it applies default color to the text.
<pre><code class="lang-csharp">function SetColor(Color value)
{
if (value.IsEmpty)
_editor.Selection.RemoveStyle(&quot;color&quot;, null);
else
{
string foreColor = System.Drawing.ColorTranslator.ToHtml(value);
_editor.Selection.ApplyStyle(&quot;color&quot;, foreColor, C1StyleType.Character);
}
}</code></pre>

</div>
