0 pts.
 dynamic visual basic form based on access database table
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

Answer Wiki:
Have you looked at the listview control. it has many different styles that probably would fit the bill. it certainly would make programming it a lot easier.
Last Wiki Answer Submitted:  October 18, 2006  4:07 pm  by  BeerMaker   0 pts.
All Answer Wiki Contributors:  BeerMaker   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 0 pts.

 

Correction to the previous posting:

a Label control cannot be shown on top of a listbox, but a TextBox can …

BR


PZ

 0 pts.