Click to See Complete Forum and Search --> : Creating forms dinamically


Dan Calin
November 4th, 1998, 03:20 AM
Is it possible to create a form dinamically during execution of a VB project ?

Is it possible to create a form dinamically inside a mdb file using a VB project ?


Dan

DragonDigital
November 4th, 1998, 05:23 AM
It depends on what you mean. If you mean create a new instance of a existing form, then yes. You can't create a new form from scratch

Dan Calin
November 4th, 1998, 07:32 AM
Depending to a certain value, I want to create a number of forms equal with that value. I am still a beginner in VB, so if you don't mind can you tell me what do you mean by a new instance of an existing form ? I read in books online that you you can't add a new form to forms collection.


Dan

DragonDigital
November 6th, 1998, 07:20 AM
You have not explained, if you want different forms generated from a database or simply several identical forms. It's true you can't add totally new forms or controls, however


If you have form, say 'MyForm', on which there are several controls.

You can something like this:

Dim AllMyForms(10) as MyForm


AllMyForms(0).Show

AllMyForms(1).Show

etc...


Ie, you can create seperate instanances of the same form, which will contain the same controls, but could contain different data. You can perform actions on the forms seperately.


If you want the forms to look different, you could do the same thing on each form, but using controls instead.


Through if you are doing a lot of this, it might be a good idea to stand back and have a good think about why.


Hope this helps