home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form ListsForm
- Caption = "ListDemo"
- ClientHeight = 4830
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6600
- LinkTopic = "Form1"
- ScaleHeight = 4830
- ScaleWidth = 6600
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command8
- Caption = "Clear List"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 3975
- TabIndex = 9
- Top = 4170
- Width = 2460
- End
- Begin VB.CommandButton Command7
- Caption = "Clear List"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 135
- TabIndex = 8
- Top = 4140
- Width = 2460
- End
- Begin VB.CommandButton Command6
- Caption = "Add New Element"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 3975
- TabIndex = 7
- Top = 3600
- Width = 2460
- End
- Begin VB.CommandButton Command5
- Caption = "Add New Element"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 135
- TabIndex = 6
- Top = 3585
- Width = 2460
- End
- Begin VB.CommandButton Command4
- Caption = "Remove Selected Items"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 3960
- TabIndex = 5
- Top = 3045
- Width = 2475
- End
- Begin VB.CommandButton Command3
- Caption = "Remove Selected Item"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 135
- TabIndex = 4
- Top = 3030
- Width = 2460
- End
- Begin VB.CommandButton Command2
- Caption = "<<"
- BeginProperty Font
- Name = "Tahoma"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 510
- Left = 2910
- TabIndex = 3
- Top = 1980
- Width = 705
- End
- Begin VB.CommandButton Command1
- Caption = ">>"
- BeginProperty Font
- Name = "Tahoma"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 510
- Left = 2910
- TabIndex = 2
- Top = 990
- Width = 705
- End
- Begin VB.ListBox List2
- Height = 1815
- Left = 3930
- MultiSelect = 2 'Extended
- Sorted = -1 'True
- TabIndex = 1
- Top = 810
- Width = 2490
- End
- Begin VB.ListBox List1
- Height = 1815
- Left = 120
- TabIndex = 0
- Top = 810
- Width = 2490
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- Caption = "Sorted List"
- BeginProperty Font
- Name = "Verdana"
- Size = 11.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 360
- Left = 3945
- TabIndex = 11
- Top = 225
- Width = 2415
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "Unsorted List"
- BeginProperty Font
- Name = "Verdana"
- Size = 11.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 360
- Left = 120
- TabIndex = 10
- Top = 225
- Width = 2415
- End
- Attribute VB_Name = "ListsForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Command1_Click()
- If List1.ListIndex >= 0 Then
- List2.AddItem List1.Text
- List1.RemoveItem List1.ListIndex
- End If
- End Sub
- Private Sub Command10_Click()
- List2.Sorted = True
- End Sub
- Private Sub Command2_Click()
- Dim i As Integer
- If List2.SelCount = 1 Then
- List1.AddItem List2.Text
- List2.RemoveItem List2.ListIndex
- ElseIf List2.SelCount > 1 Then
- For i = List2.ListCount - 1 To 0 Step -1
- If List2.Selected(i) Then
- List1.AddItem List2.List(i)
- List2.RemoveItem i
- End If
- Next
- End If
- End Sub
- Private Sub Command3_Click()
- If List1.ListIndex > 0 Then
- List1.RemoveItem List1.ListIndex
- End If
- End Sub
- Private Sub Command4_Click()
- Dim i As Integer
- If List2.SelCount = 1 Then
- List2.RemoveItem List2.ListIndex
- ElseIf List2.ListCount > 1 Then
- For i = List2.ListCount - 1 To 0 Step -1
- If List2.Selected(i) Then
- List2.RemoveItem i
- End If
- Next
- End If
- End Sub
- Private Sub Command5_Click()
- Dim listItem As String
- listItem = InputBox("Enter item to add to the list")
- If Trim(listItem) <> "" Then
- List1.AddItem listItem
- End If
- End Sub
- Private Sub Command6_Click()
- Dim listItem As String
- listItem = InputBox("Enter item to add to the list")
- If Trim(listItem) <> "" Then
- List2.AddItem listItem
- End If
- End Sub
- Private Sub Command7_Click()
- List1.Clear
- End Sub
- Private Sub Command8_Click()
- List2.Clear
- End Sub
- Private Sub Command9_Click()
- List1.Sorted = True
- End Sub
-