home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00FFFFFF&
- Caption = "BmpLst Sample"
- ClientHeight = 4815
- ClientLeft = 1470
- ClientTop = 1785
- ClientWidth = 4695
- ControlBox = 0 'False
- Height = 5220
- Left = 1410
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4815
- ScaleWidth = 4695
- Top = 1440
- Width = 4815
- Begin TextBox Text1
- Enabled = 0 'False
- Height = 285
- Left = 2880
- TabIndex = 11
- Top = 2280
- Width = 1575
- End
- Begin CommandButton Command3
- Caption = "Remove Item"
- Enabled = 0 'False
- Height = 375
- Left = 2880
- TabIndex = 10
- Top = 1200
- Width = 1575
- End
- Begin CommandButton Command2
- Caption = "Add Item"
- Enabled = 0 'False
- Height = 375
- Left = 2880
- TabIndex = 9
- Top = 720
- Width = 1575
- End
- Begin CommandButton Command1
- Caption = "Exit"
- Height = 375
- Left = 2880
- TabIndex = 8
- Top = 240
- Width = 1575
- End
- Begin Frame Frame1
- Caption = "Item Image"
- Height = 1815
- Left = 240
- TabIndex = 1
- Top = 2760
- Width = 2415
- Begin PictureBox Picture1
- BorderStyle = 0 'None
- Height = 495
- Index = 0
- Left = 240
- Picture = BMPLST.FRX:0000
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 7
- Top = 360
- Width = 495
- End
- Begin PictureBox Picture1
- BorderStyle = 0 'None
- Height = 495
- Index = 1
- Left = 240
- Picture = BMPLST.FRX:0302
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 6
- Top = 1080
- Width = 495
- End
- Begin PictureBox Picture1
- BorderStyle = 0 'None
- Height = 495
- Index = 2
- Left = 960
- Picture = BMPLST.FRX:0604
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 5
- Top = 360
- Width = 495
- End
- Begin PictureBox Picture1
- BorderStyle = 0 'None
- Height = 495
- Index = 3
- Left = 960
- Picture = BMPLST.FRX:0906
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 4
- Top = 1080
- Width = 495
- End
- Begin PictureBox Picture1
- BorderStyle = 0 'None
- Height = 495
- Index = 4
- Left = 1680
- Picture = BMPLST.FRX:0C08
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 3
- Top = 360
- Width = 495
- End
- Begin PictureBox Picture1
- BorderStyle = 0 'None
- Height = 495
- Index = 5
- Left = 1680
- Picture = BMPLST.FRX:0F0A
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 2
- Top = 1080
- Width = 495
- End
- Begin Shape Shape1
- BorderStyle = 0 'Transparent
- FillColor = &H00FFFFFF&
- FillStyle = 0 'Solid
- Height = 735
- Index = 0
- Left = 120
- Top = 240
- Width = 735
- End
- Begin Shape Shape1
- BorderStyle = 0 'Transparent
- FillColor = &H00FFFFFF&
- FillStyle = 0 'Solid
- Height = 735
- Index = 1
- Left = 120
- Top = 960
- Width = 735
- End
- Begin Shape Shape1
- BorderStyle = 0 'Transparent
- FillColor = &H00FFFFFF&
- FillStyle = 0 'Solid
- Height = 735
- Index = 2
- Left = 840
- Top = 240
- Width = 735
- End
- Begin Shape Shape1
- BorderStyle = 0 'Transparent
- FillColor = &H00FFFFFF&
- FillStyle = 0 'Solid
- Height = 735
- Index = 3
- Left = 840
- Top = 960
- Width = 735
- End
- Begin Shape Shape1
- BorderStyle = 0 'Transparent
- FillColor = &H00FFFFFF&
- FillStyle = 0 'Solid
- Height = 735
- Index = 4
- Left = 1560
- Top = 240
- Width = 735
- End
- Begin Shape Shape1
- BorderStyle = 0 'Transparent
- FillColor = &H00FFFFFF&
- FillStyle = 0 'Solid
- Height = 735
- Index = 5
- Left = 1560
- Top = 960
- Width = 735
- End
- End
- Begin BmpList BmpList1
- BorderEffect = 0 'None
- BorderStyle = 1 'Fixed Single
- BottomMargin = 60
- Height = 2415
- Left = 240
- MultiSelect = 0 'None
- Sorted = 0 'False
- TabIndex = 0
- Top = 240
- TopMargin = 30
- VertGap = 30
- Width = 2415
- End
- Begin Label Label1
- Caption = "Item Text:"
- Enabled = 0 'False
- Height = 255
- Left = 2880
- TabIndex = 12
- Top = 2040
- Width = 1215
- End
- Dim CurIndex As Integer
- Sub BmpList1_Click ()
- Dim I As Integer
- If BmpList1.ListCount = 0 Then
- Command3.Enabled = False
- Exit Sub
- End If
- Command3.Enabled = True
- If CurIndex <> -1 Then
- Picture1(CurIndex).BackColor = &HFFFFFF
- Shape1(CurIndex).FillColor = &HFFFFFF
- CurIndex = -1
- End If
- For I = 0 To 5
- If Picture1(I).Picture = BmpList1.Picture(BmpList1.ListIndex) Then
- CurIndex = I
- Picture1(CurIndex).BackColor = &HC0C0C0
- Shape1(CurIndex).FillColor = &HC0C0C0
- Exit For
- End If
- Next I
- Text1.Text = BmpList1.List(BmpList1.ListIndex)
- End Sub
- Sub Command1_Click ()
- End
- End Sub
- Sub Command2_Click ()
- ' BmpList1.ScreenUpdate = False
- BmpList1.AddItem Text1
- BmpList1.Picture(BmpList1.NewIndex) = Picture1(CurIndex).Picture
- BmpList1.ScreenUpdate = True
- End Sub
- Sub Command3_Click ()
- BmpList1.RemoveItem BmpList1.ListIndex
- If BmpList1.ListCount = 0 Then
- Command3.Enabled = False
- BmpList1.ListIndex = 0
- ElseIf BmpList1.ListIndex >= BmpList1.ListCount Then
- BmpList1.ListIndex = BmpList1.ListCount - 1
- End If
- End Sub
- Sub Form_Load ()
- CurIndex = -1
- End Sub
- Sub Picture1_Click (Index As Integer)
- If CurIndex <> -1 Then
- Shape1(CurIndex).FillColor = &HFFFFFF
- Picture1(CurIndex).BackColor = &HFFFFFF
- End If
- If CurIndex = Index Then
- CurIndex = -1
- Command2.Enabled = False
- Label1.Enabled = False
- Text1.Enabled = False
- If BmpList1.ListCount > 0 Then
- BmpList1.Picture(BmpList1.ListIndex) = Null
- End If
- Else
- Command2.Enabled = True
- Text1.Enabled = True
- Label1.Enabled = True
- CurIndex = Index
- Picture1(Index).BackColor = &HC0C0C0
- Shape1(Index).FillColor = &HC0C0C0
- If BmpList1.ListCount > 0 Then
- BmpList1.Picture(BmpList1.ListIndex) = Picture1(Index).Picture
- End If
- End If
- End Sub
- Sub Text1_Change ()
- If BmpList1.ListCount > 0 Then
- BmpList1.List(BmpList1.ListIndex) = Text1.Text
- End If
- End Sub
-