Results 1 to 2 of 2

Thread: help me to this

  1. #1

    Thread Starter
    Registered User
    Join Date
    Oct 2001
    Location
    mysore
    Posts
    60

    help me to this

    i am having two listboxes list1 nd list2.
    List1 contains some items like aa,bb,cc,dd
    and List2 contains some items like bb,ee,hh,cc.
    when i press command button aa and dd of the list1
    should move to list2 and bb and cc of list1 should be deleted.
    ie if the item of list1 macthes with the item
    of list2 then macthing item of list1 should be deleted and if it not macthes with items of list2 then it should move to list2.
    this is second time asking this question please
    some body give me the solution for this

  2. #2
    Si_the_geek
    Guest
    VB Code:
    1. For i = List1.ListCount - 1 To 0 Step -1
    2.   found_it = False
    3.   For j = 0 To List2.ListCount - 1
    4.     If List1.List(i) = List2.List(j) Then
    5.       found_it = True
    6.       Exit For
    7.     End If
    8.   Next j
    9.   If Not (found_it) Then List2.AddItem List1.List(i)
    10.   List1.RemoveItem (i)
    11. Next i

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