?
Solved

simple listview question

Posted on 1998-11-26
1
Medium Priority
?
137 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

741 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