﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Draw a Filled Rectangle on a Windows Form</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Draws a filled rectangle on a form.</Description>
      <Shortcut>drawRect</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Drawing.dll</Assembly>
        </Reference>
        <Reference>
          <Assembly>System.Windows.Forms.dll</Assembly>
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>System.Drawing</Namespace>
        </Import>
        <Import>
          <Namespace>System.Windows.Forms</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Object>
          <ID>color</ID>
          <Type>System.Drawing.Color</Type>
          <ToolTip>Replace with the brush color.</ToolTip>
          <Default>Color.Red</Default>
        </Object>
        <Object>
          <ID>form</ID>
          <Type>System.Windows.Forms.Form</Type>
          <ToolTip>Replace with a reference for the form or control to draw the ellipse on.</ToolTip>
          <Default>Me</Default>
        </Object>
        <Literal>
          <ID>size</ID>
          <ToolTip>Replace with coordinates for location and size of the ellipse.</ToolTip>
          <Default>0, 0, 200, 300</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[Using redBrush As New SolidBrush($color$), _
    formGraphics As Graphics = $form$.CreateGraphics()
    formGraphics.FillRectangle(redBrush, New Rectangle($size$))
End Using
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>