<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Dibujar una forma con un relleno degradado</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Dibuja una forma con relleno degradado.</Description>
      <Shortcut>drawGrad</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Windows.Forms</Assembly>
        </Reference>
        <Reference>
          <Assembly>System.Drawing</Assembly>
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>Microsoft.VisualBasic</Namespace>
        </Import>
        <Import>
          <Namespace>System.Drawing.Drawing2D</Namespace>
        </Import>
        <Import>
          <Namespace>System.Drawing</Namespace>
        </Import>
        <Import>
          <Namespace>System.Windows.Forms</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>x</ID>
          <ToolTip>Reemplazar por la coordenada x del lado izquierdo del rectángulo.</ToolTip>
          <Default>0</Default>
        </Literal>
        <Literal>
          <ID>y</ID>
          <ToolTip>Reemplazar por la coordenada y de la parte superior del rectángulo.</ToolTip>
          <Default>0</Default>
        </Literal>
        <Literal>
          <ID>width</ID>
          <ToolTip>Reemplazar por el ancho del rectángulo.</ToolTip>
          <Default>100</Default>
        </Literal>
        <Literal>
          <ID>height</ID>
          <ToolTip>Reemplazar por el alto del rectángulo.</ToolTip>
          <Default>100</Default>
        </Literal>
        <Literal>
          <ID>color1</ID>
          <ToolTip>Reemplazar por el primer color del gradiente.</ToolTip>
          <Default>Color.Blue</Default>
        </Literal>
        <Literal>
          <ID>color2</ID>
          <ToolTip>Reemplazar por el segundo color del gradiente.</ToolTip>
          <Default>Color.Black</Default>
        </Literal>
        <Literal>
          <ID>form</ID>
          <Type>Form</Type>
          <ToolTip>Reemplazar por el formulario o control en el que se va a dibujar la forma</ToolTip>
          <Default>Me</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[    Dim rect As New Rectangle($x$, $y$, $width$, $height$)
    Using gc = $form$.CreateGraphics()
        Using gradientBrush As New LinearGradientBrush(rect, $color1$, $color2$, LinearGradientMode.Horizontal)
            gc.FillRectangle(gradientBrush, rect)
        End Using
    End Using
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
