# C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetForegroundColor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetForegroundColor_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetForegroundColor*">SetForegroundColor Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetForegroundColor_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetForegroundColor*"></a>
<h4 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetForegroundColor_System_Drawing_Color_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetForegroundColor(System.Drawing.Color)">SetForegroundColor(Color)</h4>
<div class="markdown level1 summary"><p>Sets the color of the foreground of the device context.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Color SetForegroundColor(Color foregroundColor)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SetForegroundColor(foregroundColor As Color) As Color</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.drawing.color">Color</a></td>
      <td><span class="parametername">foregroundColor</span></td>
      <td></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="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a></td>
      <td><p>Returns the previous color of the foreground of the device context.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetForegroundColor_System_Drawing_Color__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The <b>Color</b> is used to draw the face of each character written by the <b>TextOut</b> and <b>ExtTextOut</b> functions.
The <b>Color</b> is also used in converting bitmaps from color to monochrome and vice versa.</p>
</div>
</div>
