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

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetBackgroundMode_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetBackgroundMode*">SetBackgroundMode Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetBackgroundMode_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetBackgroundMode*"></a>
<h4 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetBackgroundMode_C1_Framework_Drawing_Gdi_DeviceContexts_BackgroundMode_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetBackgroundMode(C1.Framework.Drawing.Gdi.DeviceContexts.BackgroundMode)">SetBackgroundMode(BackgroundMode)</h4>
<div class="markdown level1 summary"><p>Sets the background mode 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 BackgroundMode SetBackgroundMode(BackgroundMode backgroundMode)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function SetBackgroundMode(backgroundMode As BackgroundMode) As BackgroundMode</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="C1.Framework.Drawing.Gdi.DeviceContexts.BackgroundMode.html">BackgroundMode</a></td>
      <td><span class="parametername">backgroundMode</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="C1.Framework.Drawing.Gdi.DeviceContexts.BackgroundMode.html">BackgroundMode</a></td>
      <td><p>Returns the previous foreground mode of the device context.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetBackgroundMode_C1_Framework_Drawing_Gdi_DeviceContexts_BackgroundMode__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
  The <b>BackgroundMode</b> affects the line styles for lines drawn using a pen created
  by the <b>CreatePen</b> GDI API function. The <b>BackgroundMode</b> does not affect lines drawn using a pen created
  by the <b>ExtCreatePen</b> GDI API function.
</p>
<p>
  <code>backgroundMode</code> parameter can also be set to driver-specific values. 
  GDI passes such values to the device driver and otherwise ignores them.
</p>
</div>
</div>
