Windows Forms ListBox items

Craig Andera blogs a simple ListItemWrapper class for dealing with Windows Forms listbox items. This is such a common scenario that I’d really love to see a simple ListItem class as part of the framework (no sign of one in the March community preview release). While there’s no technical reason why it has to come from Microsoft (obviously it’s pretty easy to create - I’ve done it myself numerous times), it would cover probably 80% or more of my usage of the listbox, and that makes it worth it in my book. All we need is a ListItem class with a Text string property and a Tag object property. You could even throw in a couple of jazzy data binding bonus features if you really want.

No Comments