How do you duplicate a form (make an array)?
Printable View
How do you duplicate a form (make an array)?
A form array? Never heard of it...what on earth are u trying to do with it?
err...I dont know what its called!!! Ive seen it done all the time..how do I duplicate a form (so it shows up twice on the screen...) I dont know how else to explain itQuote:
Originally posted by nishantp
A form array? Never heard of it...what on earth are u trying to do with it?
You mean this?
VB Code:
Dim frm As New Form1 frm.Show
yup. thanks. I knew there was an easy way to do it.Quote:
Originally posted by chrisjk
You mean this?
VB Code:
Dim frm As New Form1 frm.Show
Private Sub Command1_Click()
Dim blah As New Form1
blah.Show
End Sub
:)
bah! you beat me too it :P
I am actually suprised forms dont have an index property like everything else in vb... That was my first quess on how you would do it but obviously not :D
no, no index property as forms are not controls themselves, but a container for controls... and since their not controls it eradicates the idea of a control array.
If you really want the forms in an array, you can make an array of forms:
Dim MyForms() As Form1
..and then just use it like any other array:
VB Code:
'Note: this particular bit of code will not work unless 'the array already has at least one element in it i = UBound(MyForms) + 1 ReDim Preserve MyForms(i) Set MyForms(i) = New Form1