views:

18

answers:

1

I have pairs of controls: immagebox + textbox = one pair.

I want these to show up in a single column grid/tabular format. Each cell contains one image/text pair.

I want this grid to scroll because the number of pairs is dynamic depending on a user selection.

I suppose I will be adding these controls in code at runtime when the user makes his/her selection.

What is the best way to accomplish that in vb.net? TableLayoutPanel or better way?

+2  A: 

One possible approach is the following.

Use a Panel as your container. Inside this Panel you can add a TableLayoutPanel that is defined to be AutoSize=True. Add two columns to your table layout and then add controls in rows as needed. The TableLayoutPanel will then size itself automaticlly depending on the contents.

Now make your Panel be AutoScroll=True and it will automatically add the correct scrollbars so the user can move around and see the contained set of controls.

Phil Wright
Thanks. That confirms what I discovered -- panels within panels. Or user controls w/ same. Panels can be ordinary panels or TableLayout within TableLayout. I did find it odd that short of overrride the onPaint event, my border options were single/3d black -- no colored lines or dotted lines to distinguish the cells.
pghcpa