<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Agregar un control Windows Forms en tiempo de ejecución</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Crea una instancia nueva de un control TextBox de Windows Forms en tiempo de ejecución.</Description>
      <Shortcut>formAdd</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Drawing.dll</Assembly>
        </Reference>
        <Reference>
          <Assembly>System.Windows.Forms.dll</Assembly>
        </Reference>
        <Reference>
          <Assembly>System.dll</Assembly>
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>Microsoft.VisualBasic</Namespace>
        </Import>
        <Import>
          <Namespace>System</Namespace>
        </Import>
        <Import>
          <Namespace>System.Drawing</Namespace>
        </Import>
        <Import>
          <Namespace>System.Windows.Forms</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>text</ID>
          <Type>String</Type>
          <ToolTip>El texto que se va a mostrar en el control Windows Forms.</ToolTip>
          <Default>"TextBox1"</Default>
        </Literal>
        <Literal>
          <ID>locationX</ID>
          <Type>Integer</Type>
          <ToolTip>La coordenada X de la ubicación del control.</ToolTip>
          <Default>64</Default>
        </Literal>
        <Literal>
          <ID>locationY</ID>
          <Type>Integer</Type>
          <ToolTip>La coordenada Y de la ubicación del control.</ToolTip>
          <Default>40</Default>
        </Literal>
        <Literal>
          <ID>width</ID>
          <Type>Integer</Type>
          <ToolTip>El ancho del control.</ToolTip>
          <Default>100</Default>
        </Literal>
        <Literal>
          <ID>height</ID>
          <Type>Integer</Type>
          <ToolTip>El alto del control.</ToolTip>
          <Default>20</Default>
        </Literal>
        <Object>
          <ID>controlType</ID>
          <Type>Control</Type>
          <ToolTip>Reemplazar por el tipo de control que se va a agregar.</ToolTip>
          <Default>TextBox</Default>
        </Object>
        <Literal>
          <ID>controlName</ID>
          <Type>String</Type>
          <ToolTip>Nombre de la variable del control.</ToolTip>
          <Default>TextBox1</Default>
        </Literal>
        <Literal>
          <ID>tabIndex</ID>
          <Type>Integer</Type>
          <ToolTip>El valor del orden de tabulación.</ToolTip>
          <Default>0</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[    Dim $controlName$ As New $controlType$()
    With $controlName$
        .Location = New Point($locationX$, $locationY$)
        .Size = New Size($width$, $height$)
        .TabIndex = $tabIndex$
        .Text = $text$
    End With
    Controls.Add($controlName$)

]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
