Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2005, 07:07 AM
Authorized User
 
Join Date: Jan 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default ListView Control

Pls someone help me.
I added 3 headers(style-report) for list view,
now the problem is i wanted to add items under each header.

can someone send me sample code.
:)

__________________
Thanks
Jelfy
 
Old May 3rd, 2005, 01:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This inserts one item only, with just a Text (no key or images, look at the MSDN for ListItems.Add for more options)

    With ListView1.ListItems.Add(, , "myText")
        .SubItems(1) = "first"
        .SubItems(2) = "second"
    End With

Marco
 
Old May 4th, 2005, 05:45 AM
Authorized User
 
Join Date: Jan 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default

Hi
  Thanks,I got it.
Now if we click on an item in listview entire row is getting selected.
how to get each of these individual values from each row?

Jelfy

 
Old May 4th, 2005, 04:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    Debug.Print Item.Text
    Debug.Print Item.SubItems(1)
    Debug.Print Item.SubItems(2)
End Sub

Marco
 
Old May 5th, 2005, 12:39 AM
Authorized User
 
Join Date: Jan 2005
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default

I got it.:D

Thanks Yaar
Jelfy







Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with ListView Control in C# jiggsroger C# 2005 7 April 7th, 2008 04:25 AM
About Listview control yuetqu BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 August 15th, 2006 04:56 AM
Refreshing a ListView control osemollie Pro VB 6 1 July 26th, 2006 10:00 AM
ListView Control jlr27613 C++ Programming 1 September 14th, 2004 12:58 PM
listview control jakeone Beginning VB 6 1 March 9th, 2004 08:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.