CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2000
    Posts
    20

    Listview control

    Does anyone have source code or know of a link (to a sample project) which allows you on a form with two listviews to select from one listview (for example, a set of names) and either drag to the second listview on the form or use the arrows (>, >>,<,<&lt to select\deselect names and move from one listview to another.

    I am sure this has been done thousands of time, and with current time contraints, don't really need to duplicate this code

    Thanks is advance
    R


  2. #2
    Join Date
    Apr 2001
    Posts
    95

    Re: Listview control

    Hi...
    The following may or may not work as I am unable to test it right now but you could give it a try.


    Dim NewListItem as ListItem
    Dim ItemX as ListItem

    for Each ItemX In ListView1.ListItems
    set NewListItem = _
    ListView2.ListItems.Add(,,ItemX.Text)
    next ItemX





    Not sure if that will work or even if it is what you're looking for...
    actually while you're "trying things" :-) you could try this as well


    set ListView2.ListItems = ListView1.ListItems




    Later, I'll test things and see if those actually work. :-)


  3. #3
    Join Date
    Apr 2001
    Posts
    95

    Re: Listview control

    I just tested the code I gave you...

    The fist example works... the second one does not...

    Only I would do this in the for statement

    Set NewListItem = ListView2.ListItems.Add(ItemX.Index, ItemX.Key, ItemX.Text, ItemX.Icon)




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