Results 1 to 2 of 2

Thread: Some help getting my project off the ground.

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2001
    Location
    Chicago, IL
    Posts
    49

    Some help getting my project off the ground.

    Hi all, thanks for reading

    Ok here is what im trying to do. I have an access database with a list of people.

    I want to put the list of people into a treeview on the left side of the screen. Then add people from that treeview, to a second treeview on the right side of the screen. The individuals on the treeview need to be able to be moved backwards and forwards.

    Im looking for some input on theory behind this I have been trying for a while to figure it out, but its not coming to me

    I am using vb.net.

    Thankyou much,

    Darren

  2. #2
    hellswraith
    Guest
    hello, don't know if this will help you, but I wrote some code to do this with listboxes. To use this code, put two listboxes on a form, with 4 buttons.

    VB Code:
    1. Private Sub cmdAdd_Click()
    2.     'Adds the selected file types to the selected listbox.
    3.     Dim intCount As Integer
    4.     If lstTypes.ListCount > 0 Then
    5.         For intCount = (lstTypes.ListCount - 1) To 0 Step -1
    6.             If lstTypes.Selected(intCount) Then
    7.                 lstSelected.AddItem lstTypes.List(intCount)
    8.                 lstTypes.RemoveItem (intCount)
    9.             End If
    10.         Next
    11.     End If
    12. End Sub
    13.  
    14. Private Sub cmdAddAll_Click()
    15.     'Adds all file types to the selected listbox.
    16.     Dim intCount As Integer
    17.     If lstTypes.ListCount > 0 Then
    18.         For intCount = (lstTypes.ListCount - 1) To 0 Step -1
    19.             lstSelected.AddItem lstTypes.List(intCount)
    20.             lstTypes.RemoveItem (intCount)
    21.         Next
    22.     End If
    23. End Sub
    24.  
    25. Private Sub cmdRemove_Click()
    26.     'Removes the selected file types from the selected listbox.
    27.     Dim intCount As Integer
    28.     If lstSelected.ListCount > 0 Then
    29.         For intCount = (lstSelected.ListCount - 1) To 0 Step -1
    30.             If lstSelected.Selected(intCount) Then
    31.                 lstTypes.AddItem lstSelected.List(intCount)
    32.                 lstSelected.RemoveItem (intCount)
    33.             End If
    34.         Next
    35.     End If
    36. End Sub
    37.  
    38. Private Sub cmdRemoveAll_Click()
    39.     'Removes all file types from the selected listbox.
    40.     Dim intCount As Integer
    41.     If lstSelected.ListCount > 0 Then
    42.         For intCount = (lstSelected.ListCount - 1) To 0 Step -1
    43.             lstTypes.AddItem lstSelected.List(intCount)
    44.             lstSelected.RemoveItem (intCount)
    45.         Next
    46.     End If
    47. 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