?
Solved

simple listview question

Posted on 1998-11-26
1
Medium Priority
?
139 Views
Last Modified: 2010-05-03
how do i add something to the 2nd or 3rd row over in a list view?
example:

Title 1 | Title 2 | Title 3
--------+---------+--------
item1   |subitem1 |subitem2
item2   |subitem3 |subitem4
and so on...

my question is how would i add the sub items.
I can construct the columnheaders, but i cant get the subitems.

if possible, please include any code or examples.
Thanks alot.
0
Comment
Question by:whasup55
1 Comment
 

Accepted Solution

by:
Belgarion_aus earned 380 total points
ID: 1447055
Here is a code example...

Private sub AddToList(strItem as string,strSubOne as  
    string,strSubTwo as string)

   Dim objItem as Listitem

   Set objItem = listview1.ListItems.Add(,,strItem)
   objItem.SubItems(1) - strSubOne
   objItem.SubItems(2) - strSubTwo

   set objItem = nothing

End sub
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question