Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2003, 04:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
Default Array of Forms

How can I create a [control?] array of forms?

Unlike controls the form does not have an Index property.

I have an MDI form and the user may want to open several documents, so how can I create a new form for each document in run-time?

Regards
Owain Williams
__________________
Regards
Owain Williams
 
Old July 24th, 2003, 04:20 AM
Authorized User
 
Join Date: Jun 2003
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can open a new instance of a form as you would with any object. This is then added to the form collection.
 
Old July 24th, 2003, 04:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well that was easy :).

So all I have to call is

Code:
Load New frmMDIChild
And it is added to the forms collection, thanks for that.

Regards
Owain Williams
 
Old July 24th, 2003, 05:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Owain, forms are different to control arrays - the Load statement is only needed if you want to create an invisible form; otherwise just use the Show method and that will load the form too, e.g.
Code:
Dim f As frmMDIChild
Set f = New frmMDIChild
f.Caption = "hello"
f.Show





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convering a String Array to an Integer array nkrust C# 9 November 17th, 2010 12:02 PM
Go from 2d Array to 1d array without defining type OneQuestion General .NET 1 January 10th, 2008 11:13 AM
error when sorting an Array of Array nancy VBScript 2 February 17th, 2005 12:57 PM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.