views:

596

answers:

3

Hello! I am currently working on a standard windows mobile application .It is reqired that we use a ListView , but with images in the sub items. We need a List View with 3 coulumns and three rows . i want to show 9 icons on form.

How to add images as subitems in ListView?

I can use picture box but i don't have any event to navigate from one image to another image. How can i handle it?

Thanx

+1  A: 

There is no native support for adding images as subitems in the ListView. If you know that there will always be exactly 3x3 images, why use a ListView? You can simply lay out 9 PictureBox controls on the form and load the icons into them.

Fredrik Mörk
Presumably he wants to have a ListView that shows 9 items at a time on screen, but has a scroll bar to show more if there are more than 9 items.
tomlog
A: 

The only way to do this in a standard ListView use owner-drawing.

Set the OwnerDraw property of the ListView to true, handle the DrawColumnHeader and DrawItem events and set e.Handled to true, and handle the DrawSubItem event and draw the correct images.

EDIT: The .Net Compact Framework does not support owner drawing, so this technique cannot be used.

SLaks
The CF ListView cannot be owner-drawn. It doesn't support overriding any of the drawing functions.
ctacke
A: 

It might be worth checking out this article. Although it's written for the full .NET Framework, it might also work for the Compact Framework (I have not tested it myself, but NMCUSTOMDRAW seems to be supported by Win CE).

tomlog