CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Urgent!!!!!!

  1. #1
    Join Date
    Nov 1999
    Location
    India
    Posts
    10

    Urgent!!!!!!

    Hi everybody
    can i select multiple columns or rows from a listview.
    Actually what i want to do is i want to select multiple rows or columns from a listview and extract the selected rows/columns in some array and perform some operations on those values.

    thanx in advance


  2. #2
    Join Date
    Dec 1999
    Location
    Baltiore, MD, USA
    Posts
    8

    Re: Urgent!!!!!!

    Hi.
    Selection of multiple rows is possible. Here is a sample code on how to do it. If you have other questions e-mail me at [email protected]

    option Explicit


    private Sub cmdOk_Click()
    Dim i as Integer
    Dim t as string
    for i = 1 to lvwList.ListItems.Count
    If lvwList.ListItems.Item(i).Selected = true then
    t = lvwList.ListItems.Item(i).Text + _ lvwList.ListItems.Item(i).SubItems(1) + _ lvwList.ListItems.Item(i).SubItems(1)
    End If
    next
    End Sub

    private Sub Form_Load()
    With lvwList.ListItems.Add(, , "Test1")
    With .ListSubItems.Add(, , "Test1.2")
    End With
    With .ListSubItems.Add(, , "Test1.3")
    End With
    End With
    With lvwList.ListItems.Add(, , "Test2")
    With .ListSubItems.Add(, , "Test2.2")
    End With
    With .ListSubItems.Add(, , "Test2.3")
    End With
    End With
    With lvwList.ListItems.Add(, , "Test3")
    With .ListSubItems.Add(, , "Test3.2")
    End With
    With .ListSubItems.Add(, , "Test3.3")
    End With
    End With
    With lvwList.ListItems.Add(, , "Test4")
    With .ListSubItems.Add(, , "Test4.2")
    End With
    With .ListSubItems.Add(, , "Test4.3")
    End With
    End With
    With lvwList.ListItems.Add(, , "Test5")
    With .ListSubItems.Add(, , "Test5.2")
    End With
    With .ListSubItems.Add(, , "Test5.3")
    End With
    End With
    With lvwList.ListItems.Add(, , "Test6")
    With .ListSubItems.Add(, , "Test6.2")
    End With
    With .ListSubItems.Add(, , "Test6.3")
    End With
    End With
    End Sub





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured