Ideas on doing this idea? Anyone?

Inkybro
01-20-2005, 07:49 PM
I have a new program idea that requires me to somehow load forms, but of course "Load frmMain(Index)" wouldn't work because you can't give forms indexes (or can you)?

Does anyone know a way I can do this still?

Myth
01-21-2005, 01:07 AM
Dim myForm(4) As Form
Dim i As Integer
For i = LBound(myForm) To UBound(myForm)
Set myForm(i) = New Form1
myForm(i).Show
Next i

I just tried that and it worked.
Form1 is a normal Form with a CommandButton CommandButton1 on it :D

zelg37
01-21-2005, 10:14 PM
you can't give forms indexes (or can you)?
All created forms in Visual Basic are part of a forms collection. You can access a particular form using it's collection index.

Forms(Index)

Interested in reading more:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbobjForm.asp

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum