Solved

simple listview question

Posted on 1998-11-26
1
129 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 190 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now