CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    Creating forms dinamically



    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

  2. #2
    Join Date
    Nov 1998
    Posts
    10

    Re: Creating forms dinamically



    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

  3. #3
    Join Date
    Apr 1999
    Posts
    3

    Re: Creating forms dinamically



    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

  4. #4
    Join Date
    Nov 1998
    Posts
    10

    Re: Creating forms dinamically



    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured