A Control's ProgID, as mentioned above,
is a unique system-wide string that the Windows
operating system can use to identify your control's
type. You must know the ProgID of any control
that you want to add to the Controls Collection
because the Add method will require it as an
argument.
For VB intrinsic controls the ProgID is usually
formed by combining the characters VB. with
the VB name of the control's type (CommandButton,
TextBox, or Label for example). So, for example,
the ProgID for CommandButtons is VB.CommandButton
and the ProgID for Labels is VB.Label.
If you want to add an ActiveX control (a non-intrinsic
control) to the Controls Collection, you'll
either need to have some documentation at hand
or you'll need to do some investigation
in the Windows Registry.
In order to find the ProgID for a control's
type in the Windows Registry, you can run Regedit
from the Start/Run menu option of your Windows
desktop. Perform an Edit/Search in Regedit for
the name of the control. Repeat the search with
the F3 key until you find the ProgID entry (see
Figure 4.15). You can use this key with the
Add method.

FIGURE 4.15 Finding a control's ProgID in the Windows Registry using the Regedit
utility.
Adding and Deleting Controls Dynamically Using the Controls Collection
Topics
Related Topics
See Also
<< Previous | Contents
| Next >>