ImageList Question

  • Thread starter Thread starter Tiraman :-\)
  • Start date Start date
T

Tiraman :-\)

Hi ,

i would like to have a form/panel or some thing like that
which will display the list of images on it
and will implement an onclick for each image.

what is the best way to do that ?

Thanks

T :-)
 
* "Tiraman :-\) said:
i would like to have a form/panel or some thing like that
which will display the list of images on it
and will implement an onclick for each image.

Use a listview control and assign the imagelist to its 'LargeImageList'
property. Then set the 'View' property accordingly, loop through the
images in the imagelist and add dummy items to the listview control.
 
Hi

Add one ImageList Control and ListView control in your form/panel. Load the
images in the ImageList. Set ListView Control's
View property to System.Windows.Forms.View.SmallIcon or
System.Windows.Forms.View.Largecon.

Set SmallImageList/LargeImageList to the ImageList Control. Add items in the
ListView and set ImageIndex and Text (if required) properties.

On the Click Event of the ListView Control use the code like:

Select case CType(sender, ListView).SelectedItems(0).ImageIndex
Case 0
'Code for the First Image click
Case 1
'Code for the second Image click
Case 2
'Code for the third Image click
End Select

Regards

SoorajPM
Microsoft India Community Star
 
Hi ,

first thanks for your answers.

2nd - what about using the GDI in order to draw the images on the form ?

is it a good way ? what about performance ?

T:-)
 
* "Tiraman :-\) said:
first thanks for your answers.

2nd - what about using the GDI in order to draw the images on the form ?

is it a good way ? what about performance ?

What will work too, but it's a lot of work and I don't see any
advantages over using the listview control.
 
One more question,

how can i set the width between each image on the list and how can i set the
number of items to display in each row ?

i would like to have some thing like this (4 items on each row and the width
between the items is 10px)

1 2 3 4

5 6 7 8

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top