Creating new forms from code
Posted on 2003-11-11
How can I create new forms or any other objects only from code?
I have seen somewhere, that this can be done by using New keyword, but I don't know how exactly it works.
This is what I have so far:
Dim form2 As New Form1
This creates new form which looks like form1, but I want to create completely new and empty form.
Can I create an array of forms? form(0), form(1), form(2) . . .
How do I change properties of new forms? My example gives 'Object Required' error when I try: form2.caption = "abcdefg"
If possible, can you give me code example that would do the following:
- create 2 new empty forms, and display them
- change caption for first form
- create button on second form