VB6 - Creating Control Array at Run Time 
Author Message
 VB6 - Creating Control Array at Run Time

Hello, i 'm trying to create a control array using the new features of VB6,

Private txtExemple(0 to 3) as TextBox,
set txtExemple(0) = frmMain.controls.add("VB.TextBox","txt1")

but this doesn't work as i expected , because it doesn't fire the events. If
i try another aproach like

Private withevents txtExemple(0 to 3) as TextBox, VB6 doesnt support this
syntax.

if there's someone that can help me, I'd appreciate it very much.

Thanks for your concern.

Daniel Barata



Fri, 06 Apr 2001 03:00:00 GMT  
 VB6 - Creating Control Array at Run Time
The old way of doing it is to use a control array.

Add a textbox to a form, set the Index property to 0.

Then to add more textboxes:

For i = 1 to 10
  Load Text1(i)
  Text1(i).Visible = true
Next i

Andy H

Quote:

>Hello, i 'm trying to create a control array using the new features of VB6,

>Private txtExemple(0 to 3) as TextBox,
>set txtExemple(0) = frmMain.controls.add("VB.TextBox","txt1")

>but this doesn't work as i expected , because it doesn't fire the events.
If
>i try another aproach like

>Private withevents txtExemple(0 to 3) as TextBox, VB6 doesnt support this
>syntax.

>if there's someone that can help me, I'd appreciate it very much.

>Thanks for your concern.

>Daniel Barata



Sat, 07 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating controls in a control array at run-time

2. create & add controls array in run time

3. Creating Control Arrays At Run Time

4. Creating Controls at Run time using Collections not Arrays

5. Create Control Array and add item at run time

6. Creating control arrays at run time?

7. create a control array at run time

8. Creating array of controls at run time

9. VB6, Run-Time Properties and Creating Dynamic Controls.

10. Newbie - How to Create a .mdb database from run time in VB6

11. Creating tables at run time with ADO 2.5 and VB6

12. Adding elements to a control array of Menu items with subMenus at Run time

 

 
Powered by phpBB® Forum Software