DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: listview control

  1. #1
    Join Date
    Aug 2004

    listview control

    [Originally posted by ada]

    just start to use this one.

    One simple question, how to add an item to the control. I searched some sites but didn't find any way to add to it.

    and what's the normal use of listview control?

  2. #2
    Join Date
    Aug 2004

    Re:listview control

    [Originally posted by John Citizen]

    The listview control works like the folder viewer in windows.

    You add an item this way:

    MyListView.ListItems.Add , "MyItemKey" ,"Hello World"

    My normal use of the Listview controls is generally to create Lists of items. (I prefer it over the List control). You can however use it to display icons wiht little names and the like, just like when you are looking at the contents of a folder with windows.

    John Citizen

  3. #3
    Join Date
    Aug 2004

    Re:Re:listview control

    [Originally posted by ada]

    Thanks, awsome, you reply so soon.

    I make it add 3 items, but
    1) the 3 are far away from each other, the first one is 1cm higher than the second one.

    Do you how to adjust the distance?

    2) To make it more beautiful, how to let it display icons instead of checkboxes, just like, what you said, the explorer in windows?

  4. #4
    Join Date
    Aug 2004

    Re:Re:Re:listview control

    [Originally posted by John Citizen]

    To add pictures to the ListView control you have to do the following:

    1) add an ImageList object to your form.

    2) Add a series of pictures to the ImageList so that you have about 5 or so images in it.

    3) Set the ImageList property of the ListView control to the name of the ImageList you put on your form.

    4) When you add a ListItem object you can now specify a SmallIcon or Icon property. This will make the ListView show the picture in the imagelist.

    (If you assigned the ImageList to the Icon ImageList property)
    MyListView.ListItems.Add , "MyListKey", "HelloWorld", 1


    (If you assigned the ImageList to the SmallIcon ImageList property)
    MyListView.ListItems.Add , "MyListKey", "HelloWorld", , 1

    You may have to change the View property of the ImageList control if you dont see the images straight away.

    John Citizen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center