
Dynamically Creating Controls at Runtime
Actually, you are very close. The code "Dim newTextBox as New Textbox" will
work if you create a Text Box, at design time, called newTextBox AND make
it the first member of a control array, i.e. set the Index property to 0.
Then each time you dimension a new Text Box the Index property will be
incremented automatically. You then use the Index property to tell which
Text Box you are accessing.
Quote:
> I have an application where I would like to create controls on a form at
runtime.
> I am not certain how many controls and what types of controls I will need
until
> then, because it is table driven. I know that I cannot do the following:
> Dim newTextBox as New Textbox
> All object variables need to be set to point to existing instances of the
basic
> controls, and the New keyword cannot be used to create new controls. Are
there
> any tricks to do this?
> Thanks in advance,
> Ryan Sutter
> P.S. - If you have a suggestion, please e-mail me at
Quote:
> have limited Usenet access.