# GrapeCity.Drawing.IDrawingContext.DrawRectangle

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Drawing_IDrawingContext_DrawRectangle_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawRectangle*">DrawRectangle Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Drawing_IDrawingContext_DrawRectangle_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawRectangle*"></a>
<h4 id="GrapeCity_Drawing_IDrawingContext_DrawRectangle_GrapeCity_Drawing_Brush_GrapeCity_Drawing_Pen_GrapeCity_Drawing_Rectangle_" data-uid="GrapeCity.Drawing.IDrawingContext.DrawRectangle(GrapeCity.Drawing.Brush,GrapeCity.Drawing.Pen,GrapeCity.Drawing.Rectangle)">DrawRectangle(Brush, Pen, Rectangle)</h4>
<div class="markdown level1 summary"><p>Draws a rectangle with the specified <a class="xref" href="GrapeCity.Drawing.Brush.html">Brush</a> and <a class="xref" href="GrapeCity.Drawing.Pen.html">Pen</a>. The pen and the brush can be null.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void DrawRectangle(Brush brush, Pen pen, Rectangle rect)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub DrawRectangle(brush As Brush, pen As Pen, rect As Rectangle)</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="GrapeCity.Drawing.Brush.html">Brush</a></td>
      <td><span class="parametername">brush</span></td>
      <td><p>The brush with which to fill the rectangle. This is optional, and can be null. If the brush is null, no fill is drawn.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Pen.html">Pen</a></td>
      <td><span class="parametername">pen</span></td>
      <td><p>The pen with which to stroke the rectangle. This is optional, and can be null. If the pen is null, no stroke is drawn.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.Rectangle.html">Rectangle</a></td>
      <td><span class="parametername">rect</span></td>
      <td><p>The rectangle to draw.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
