Results 1 to 3 of 3

Thread: Listview help please!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123

    Listview help please!

    I'm in need of some help and some code if possible, I have a listview box with headers named Area and another called function.
    I have lots of buttons on a form that are used for selecting different areas of a building, when these are pressed i need to add the button name (caption) under the area header. If any of the buttons is not pressed then it removes that button name from the list. Also, When any of the buttons is pressed depending what colour it is it puts a function under the fuction header.

    eg:
    When button Level 1 is pressed and its green then it would put this in my listview box.

    Area | Function
    ------------------------------
    Level1 | Pagging

    When the button is not pressed it removes this information only for level 1.

    Can anyone help me do this? Hope this is explained ok.

    Thanks to all in advance.
    Last edited by Adrian26; Mar 4th, 2003 at 11:31 AM.

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    Sme code snippets for you to work with:

    Clear the ListView:
    ListView1.ListItems.Clear

    Add something to the ListView - 2 columns:
    Set ItmX = ListView1.ListItems.Add(, , "First Col")
    ItmX.SubItems(1) = "Second Col"

    To remove something, start at the end and work forwards:
    for i = ListView1.ListItems.Count to 0 step - 1

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    UK
    Posts
    123
    thanks,

    i will see what i can do now!

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