Getting a handle to a form

Renidrag
04-02-2003, 10:48 AM
I have a form that I want to create mulitiple instances of (not MDI) and what I need to do is update a label in each form if needed.

How do I call a certian form for updating?

jayceepoo
04-02-2003, 11:26 AM
Is something like this what you mean?

Dim f1 as New Form1
Dim f2 as New Form1
Dim f3 as New Form1

f1.Show
f2.Show
f3.Show

f1.label1.Caption = "This text has changed."

Renidrag
04-02-2003, 11:40 AM
Is something like this what you mean?

Dim f1 as New Form1
Dim f2 as New Form1
Dim f3 as New Form1

f1.Show
f2.Show
f3.Show

f1.label1.Caption = "This text has changed."



Yes something like that but the only thing is these "f1, f2, f3" would not be declared they have to be created dynamiclly.

but I could create them and store them in an Array and use them as need or something like that.

GavinO
04-02-2003, 05:24 PM
You can set the index value of Form1, and then create the new forms by 'Load Form1(NumForms) / NumForms=NumForms+1'

Renidrag
04-02-2003, 07:34 PM
You can set the index value of Form1, and then create the new forms by 'Load Form1(NumForms) / NumForms=NumForms+1'

Set the form1 index? Like a control array?
I have set the index of pretty much everything else before but never a form.
Where would you set it?

GavinO
04-02-2003, 07:46 PM
Okay, I screwed up. I could have sworn that it was done like that, but there is indeed no Index property. Deepest apologies on the bad lead.

Spike
04-02-2003, 08:12 PM
You can do something like this:


Dim f as form

Set f = new frmMain 'Where frmMain is the form you want to copy
f.show


You can also have f as an array so you can keep track of things better.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum