VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5700
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   5700
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdTo 
      Caption         =   ">"
      Height          =   255
      Left            =   2400
      TabIndex        =   5
      Top             =   720
      Width           =   615
   End
   Begin VB.CommandButton cmdBack 
      Caption         =   "<"
      Height          =   255
      Left            =   2400
      TabIndex        =   4
      Top             =   1440
      Width           =   615
   End
   Begin VB.CommandButton cmdToAll 
      Caption         =   ">>"
      Height          =   255
      Left            =   2400
      TabIndex        =   3
      Top             =   1080
      Width           =   615
   End
   Begin VB.CommandButton cmdBackAll 
      Caption         =   "<<"
      Height          =   255
      Left            =   2400
      TabIndex        =   2
      Top             =   1800
      Width           =   615
   End
   Begin VB.ListBox lstTo 
      Height          =   2010
      Left            =   3240
      MultiSelect     =   2  'Extended
      TabIndex        =   1
      Top             =   480
      Width           =   1935
   End
   Begin VB.ListBox lstFrom 
      Height          =   2010
      Left            =   240
      MultiSelect     =   2  'Extended
      TabIndex        =   0
      Top             =   480
      Width           =   1935
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdBack_Click()
Dim i As Long
For i = lstTo.ListCount - 1 To 0 Step -1
   If lstTo.Selected(i) = True Then
      lstFrom.AddItem lstTo.List(i)
      lstTo.RemoveItem i
   End If
Next
End Sub

Private Sub cmdBackAll_Click()
Dim i As Long
   For i = 0 To lstTo.ListCount - 1
       lstFrom.AddItem lstTo.List(i)
   Next
   lstTo.Clear
End Sub


Private Sub cmdTo_Click()
Dim i As Long
For i = lstFrom.ListCount - 1 To 0 Step -1
   If lstFrom.Selected(i) = True Then
      lstTo.AddItem lstFrom.List(i)
      lstFrom.RemoveItem i
   End If
Next
lstTo.Enabled = True
End Sub

Private Sub cmdToAll_Click()
Dim i As Long
   For i = 0 To lstFrom.ListCount - 1
       lstTo.AddItem lstFrom.List(i)
   Next
   lstTo.Enabled = True
   lstFrom.Clear
End Sub

Private Sub Form_Load()
With lstFrom
    .AddItem "Oranges"
    .AddItem "Apples"
    .AddItem "Pears"
    .AddItem "Peaches"
    .AddItem "Plums"
    .AddItem "Prunes"
    .AddItem "Bananas"
End With
    
End Sub


