views:

603

answers:

3

I have two lists of data. To represent an "item" I have a custom UserControl (as the item has multiple fields and I want to lay it out correctly on the UserControl).

I would like the list to be populated on some type of ListBox by these user controls instead of strings.

I have seen people do this in WPF using ItemsControl or some repeater. Do you know if there is any way to do this in WinForms?

I want to ensure that I get the proper vertical scrolling if the number of user controls is bigger than the container.

+2  A: 

In .NET 3.5 SP1 the DataRepeater component was added to the framework as part of WinForms (rather than as part of the VB PowerPack downloadable add-on). If you're running on that version of the framework then it might do what you need.

Matt Hamilton
A: 

FlowLayoutPanel seems to do the job

ooo
A: 

You can try a 3rd party control like IntegralUI ListBox from Lidor Systems.

It allows you to create a list of items filled with custom objects like: controls, text, images, hyperlinks etc.

You can create your own templates and order the item content in custom layouts.

Lokey