Results 1 to 4 of 4

Thread: Resolved :List view

  1. #1

    Thread Starter
    Hyperactive Member yousufkhan's Avatar
    Join Date
    Jan 2002
    Location
    India
    Posts
    492

    Resolved Resolved :List view

    i wanted to have a picture or icon in the list view with every row
    how can do this
    Last edited by yousufkhan; Aug 11th, 2006 at 05:52 AM.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: List view

    You need to add an ImageList control to your Form and add the images you want to use to that. The easiest way of doing that is during design-time. Right click the ImageList and select properties. In the Properties Pages dialog that appears select the Images tab and click the Add button to add one image. You can, if you want, give the image a Key value.

    Next right click your ListView control and select Properties. Now select your ImageList in the ImageList property drop-down list. When you add items to the ListView you can specify which images you should use from the ImageList, either by Index (1 is the first image) or by Key name.

  3. #3

    Thread Starter
    Hyperactive Member yousufkhan's Avatar
    Join Date
    Jan 2002
    Location
    India
    Posts
    492

    Re: List view

    I have added the imagelist and inserted the icons and i have also
    added the imagelist in property of listview imagelist but how to specify which image should use from the imagelist
    Last edited by yousufkhan; Aug 11th, 2006 at 05:48 AM. Reason: Resolved

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: List view

    VB Code:
    1. 'by index
    2.    ListView1.ListItems.Add , , "test", 1 'for a large icon
    3.    ListView1.ListItems.Add , , "test", , 1 'for a small icon
    4.    
    5.    'by key
    6.    ListView1.ListItems.Add , "test", "test" 'f.e. key value is test

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width