Create an control at runtime?

CJBIRKIN

Drink!
Local time
Today, 14:34
Joined
May 10, 2002
Messages
255
Hi

Does anyone know if you can create a control, say an textbox, on a form without it being in design view. i.e if i click a button on a form the textbox is created.

Cheers

Chris
 
Chech the help files for the CreateControl Function.

HTH
 
Hi

I had checked and it said you could only do it in design view, however as you can in VB5 etc i wondered if there was a work around.


Chris
 
You can do this, but you would need to have code to close the form, reopen in design mode, and then create the control, save, and then reopen the form. At least with Access. It's true that in VB6 you can create controls on the fly on an open form.
 

Users who are viewing this thread

Back
Top Bottom