开发者

C# make a list with image and label like Messenger

How can I build on C# a a list like 开发者_StackOverflowon Messenger where contacts appear with an image and a text with the contact's name? What components should I use to build it? Using Winforms by the way.

Thanks


Look at the ListView control. It provides you with the ability to have a list of items and also bind a ImageList which provides icons for each entry.

http://ondotnet.com/pub/a/dotnet/2002/10/28/listview.html


A ListView is the right choice here. Drop an ImageList on the form as well, that stores the images. Set the ListView's View property to Tile and its TileSize to the size of the tiles you want. For each item you add to the list view, set its Text property to the label you want to show to the right of the image. And the ImageIndex property to the index of the image in the ImageList. You can try this all out in the designer without writing code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜