Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple copies of the same form

Status
Not open for further replies.

dragnut

Technical User
Dec 27, 2000
125
US
Hi all, I am using vb4-16 and/or vb3. I want to make like a control array of a form to put say 10 of the same form on screen at the same time, in different places on screen. I cant figure this out. any advice?
Thanks,
Dragnut
 
Create a new form for each instance you want like this:
Assume that the name of the form is Form1.

Dim objForm1 as Form
Dim objForm2 as Form

Set objForm1 = New Form1
Set objForm2 = New Form1

Then all you have to do is move the form or set the left and top properties of them and then you can position them where you like. Snaggs
tribesaddict@swbell.net
2 wire mesh butchering gloves:
1 5-finger, 1 3-finger, pair: $15
 
Or if you want 10 forms in an array try:-

dim frm(10) as form

set frm(0) = new form1
set frm(1) = new form1
set frm(2) = new form1
set frm(9) = new form1

each form is then accessable using:-

frm(3)!UserName = "John Smith"
frm(3)!UserTel = "020282828282"
frm(3).show
etc

or you could create your own collection of forms (which will allow you to add and remove forms from memory without having to decide at design time how many or how few you will require.

For more information see the MS VB6.0 Programming Guide, which for a Microsoft Book, explains thing quite well (probably becuase it doesnt come free with VB)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top