Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listview add

Status
Not open for further replies.

gustaf111

Programmer
Jan 16, 2011
87
0
0
SE
Hello,

I'm using VBA to add strings to a listview. The Listview control I'm using is Microsoft LisView Control 6.0 (SP4).

order_AN76.ListItems.Add 1 ,"a" , 1
order_AN76.ListItems(1).SubItems(1)="1"
order_AN76.ListItems(1).SubItems(2)="1"
order_AN76.ListItems(1).SubItems(3)="1"
order_AN76.ListItems(1).SubItems(4)="1"

order_AN76.ListItems.add 2 ,"b" , 2
order_AN76.ListItems(2).SubItems(1)="2"
order_AN76.ListItems(2).SubItems(2)="2"
order_AN76.ListItems(2).SubItems(3)="2"
order_AN76.ListItems(2).SubItems(4)="2"

...

The result will be:

1 1 1 1 1
2 2 2 2 2


order_AN76 is the Listview. I do not understand why I need to write "a" , "b" ... ?

Best Regards Gustaf




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top