-
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.
-
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
-
thanks,
i will see what i can do now!