Click to See Complete Forum and Search --> : Spawning new windows


nilch
June 13th, 2001, 03:25 PM
I want to open up new windows from a procedure in VB and based on a parameter I pass to each window.
Based on this parameter each window will show same form but data will slightly differ based on calculation with the passing parameter.

And I want to be able to open n number of windows where n is a not too big variable.
How can I do this ?

Thankx in advance to all

Clearcode
June 14th, 2001, 03:37 AM
You can use a Visual Basic designed form as if it were a class.
Thus, for example, we have a form which displays a customer address. In the form there is a public property defined thus:


'from frmAddress
public property let AddressId(byval lId as Long)

me.txtID.Text = CStr(lId)
'fill othyer fields by looking up address...
End property




Now to load a number of these, from an array of ids do the following.


Dim lIndex as Long
Dim frmThis as frmAddress

for lIndex = LBound(ArrIds) to UBound(ArrIds)
set frmThis = new frmAddress
frmThis.AddressId = ArrIds(lIndex)
frmThis.Show
next lIndex




HTH,
D.

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com