Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can dynamically add controls to a form or other container (such as a UserControl) using the <code>Add</code> method of the container's <code>Controls</code> collection. For example, to add a TextBox named <code>myTextBox</code> to a form called frmMyForm, you could do this:</p> <p><code>frmMyForm.Controls.Add "VB.TextBox", "myTextBox"</code></p> <p>Here is a snippet from the VB6 help file:</p> <blockquote> <h3>Add Method (Controls Collection) </h3> <p><br/> Adds a control to the <strong>Controls</strong> collection and returns a reference to the control.</p> <p><strong>Syntax</strong></p> <p><em>object</em>.<strong>Add</strong> <strong>(***ProgID, name, container*</strong>)**</p> <p>The <strong>Add</strong> method syntax has these parts:</p> <p><em>object</em> (Required)</p> <p>An object expression that evaluates to an object in the <strong>Applies To</strong> list.</p> <p><em>ProgID</em> (Required)</p> <p>A string that identifies the control. The ProgID of most controls can be determined by viewing the Object Browser. The ProgID is composed of the Library and Class of the control. For example, the CommandButton control's ProgID is VB.CommandButton. In cases where the ProgID differs from that shown in the Object Browser, Visual Basic displays an error message that contains the correct ProgId.</p> <p><em>name</em> (Required) </p> <p>A string that identifies the member of the collection.</p> <p><em>container</em> (Optional)</p> <p>An object reference that specifies a container of the control. If not specified or NULL, defaults to the container to which the Controls collection belongs. You can put a control in any existing container control (such as the Frame control) by specifying this argument. A user control or an ActiveX document can also be a container.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload