I am useing an access database table to populate some lists. I want to dynamicly add picture boxes that I use to seperate the list box as if lined based on how many records I have in the database. Basicly, I just need to know how to add a control by code. I don't want to have to place 100 picture boxes when I won't use but 20, but may in the future of the program when there are more entries in the populate database and may need 100. Thanks in advance.
Software/Hardware used:
ASKED:
October 18, 2006 12:39 PM
UPDATED:
October 19, 2006 10:42 AM
You can use a controll array (in VB6).
Insert a PictureBox somewhere on your form, make it invisible, and set its Index property to 0.
Use the Load method with the next unused index to create a new instance, move it where you need and make it visible.
Btw. for using as separator a Label can do just as well, and it uses much less resources.
Correction to the previous posting:
a Label control cannot be shown on top of a listbox, but a TextBox can …
BR
–
PZ