(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-29-24 04:53 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Loading Object that's an Array VB6
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
olafnes
Posts: 11/11

On Error Resume Next

Dim blah As Integer

For blah% = 0 To 49
Load TextBox1(blah%)
TextBox1.Visible = True
Next blah%


assuming you've already created at least TextBox1(0) -- it will create 49 more text boxes -- they'll stack on top of each other at left: 0, top: 0
Guy Perfect
Posts: 288/451
Assuming you mean an Object Array in that the Index property is different for them each...

Using a single object on the Form at design time, make its Index property equal to 0. When you run code in your program, you can generate new objects with the Load statement. Let's assume your object is a TextBox control. This is the code you'd use:
Load TextBoxArray(1)
TextBoxArray(1).Left = 256
TextBoxArray(1).Top = 128
TextBoxArray(1).Visible = True
Easy as pie, really. When you use the Load statement, make sure you set all applicable properties. I'm not sure what the default property values are, but I think it copies them from the object in the array whose Index is the lowest.

And, of course, when you want to destroy an object, say Unload TextBoxArray(1).
interdpth
Posts: 152/362
Ok, so I make an array of say textboxes. One is showing and that is 0 in the array. So i'd like to know how I can show some number of them. And how I can hide them and reload them or something like that. Thanks!
Acmlm's Board - I3 Archive - Programming - Loading Object that's an Array VB6


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.010 seconds; used 348.58 kB (max 381.60 kB)