Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Small Icons in a ListView

Status
Not open for further replies.

Echilon

Programmer
Feb 22, 2007
54
GB
I need to display a grid of icons to allow a user to select one. The only way I can think of doing this is with a ListView in Small Icons view, which works, but not as I need. The problem is that the width of each item is too big. For example, the ListView is filled using this code:

for(int i = 0; i < Constants.IconNames.Length; i++) {
ListViewItem itm = new ListViewItem();
itm.ImageIndex = i;
itm.Tag = i;
lstIcon.Items.Add(itm);
if(eventObject.Icon == i) {
itm.Selected = true;
}
}
IconNames is an array of icon names, which are resx resources, and used to fill the small image list for the ListView.

listview.png


However, as the screenshot shows, the items don't have a settable width property. Is there any way around this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top