home *** CD-ROM | disk | FTP | other *** search
/ CD Direkt 1995 #1 / Image.iso / cdd / source / vbsource / bmplst / bmplst.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-06-29  |  8.9 KB  |  290 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "BmpLst Sample"
  5.    ClientHeight    =   4815
  6.    ClientLeft      =   1470
  7.    ClientTop       =   1785
  8.    ClientWidth     =   4695
  9.    ControlBox      =   0   'False
  10.    Height          =   5220
  11.    Left            =   1410
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4815
  16.    ScaleWidth      =   4695
  17.    Top             =   1440
  18.    Width           =   4815
  19.    Begin TextBox Text1 
  20.       Enabled         =   0   'False
  21.       Height          =   285
  22.       Left            =   2880
  23.       TabIndex        =   11
  24.       Top             =   2280
  25.       Width           =   1575
  26.    End
  27.    Begin CommandButton Command3 
  28.       Caption         =   "Remove Item"
  29.       Enabled         =   0   'False
  30.       Height          =   375
  31.       Left            =   2880
  32.       TabIndex        =   10
  33.       Top             =   1200
  34.       Width           =   1575
  35.    End
  36.    Begin CommandButton Command2 
  37.       Caption         =   "Add Item"
  38.       Enabled         =   0   'False
  39.       Height          =   375
  40.       Left            =   2880
  41.       TabIndex        =   9
  42.       Top             =   720
  43.       Width           =   1575
  44.    End
  45.    Begin CommandButton Command1 
  46.       Caption         =   "Exit"
  47.       Height          =   375
  48.       Left            =   2880
  49.       TabIndex        =   8
  50.       Top             =   240
  51.       Width           =   1575
  52.    End
  53.    Begin Frame Frame1 
  54.       Caption         =   "Item Image"
  55.       Height          =   1815
  56.       Left            =   240
  57.       TabIndex        =   1
  58.       Top             =   2760
  59.       Width           =   2415
  60.       Begin PictureBox Picture1 
  61.          BorderStyle     =   0  'None
  62.          Height          =   495
  63.          Index           =   0
  64.          Left            =   240
  65.          Picture         =   BMPLST.FRX:0000
  66.          ScaleHeight     =   495
  67.          ScaleWidth      =   495
  68.          TabIndex        =   7
  69.          Top             =   360
  70.          Width           =   495
  71.       End
  72.       Begin PictureBox Picture1 
  73.          BorderStyle     =   0  'None
  74.          Height          =   495
  75.          Index           =   1
  76.          Left            =   240
  77.          Picture         =   BMPLST.FRX:0302
  78.          ScaleHeight     =   495
  79.          ScaleWidth      =   495
  80.          TabIndex        =   6
  81.          Top             =   1080
  82.          Width           =   495
  83.       End
  84.       Begin PictureBox Picture1 
  85.          BorderStyle     =   0  'None
  86.          Height          =   495
  87.          Index           =   2
  88.          Left            =   960
  89.          Picture         =   BMPLST.FRX:0604
  90.          ScaleHeight     =   495
  91.          ScaleWidth      =   495
  92.          TabIndex        =   5
  93.          Top             =   360
  94.          Width           =   495
  95.       End
  96.       Begin PictureBox Picture1 
  97.          BorderStyle     =   0  'None
  98.          Height          =   495
  99.          Index           =   3
  100.          Left            =   960
  101.          Picture         =   BMPLST.FRX:0906
  102.          ScaleHeight     =   495
  103.          ScaleWidth      =   495
  104.          TabIndex        =   4
  105.          Top             =   1080
  106.          Width           =   495
  107.       End
  108.       Begin PictureBox Picture1 
  109.          BorderStyle     =   0  'None
  110.          Height          =   495
  111.          Index           =   4
  112.          Left            =   1680
  113.          Picture         =   BMPLST.FRX:0C08
  114.          ScaleHeight     =   495
  115.          ScaleWidth      =   495
  116.          TabIndex        =   3
  117.          Top             =   360
  118.          Width           =   495
  119.       End
  120.       Begin PictureBox Picture1 
  121.          BorderStyle     =   0  'None
  122.          Height          =   495
  123.          Index           =   5
  124.          Left            =   1680
  125.          Picture         =   BMPLST.FRX:0F0A
  126.          ScaleHeight     =   495
  127.          ScaleWidth      =   495
  128.          TabIndex        =   2
  129.          Top             =   1080
  130.          Width           =   495
  131.       End
  132.       Begin Shape Shape1 
  133.          BorderStyle     =   0  'Transparent
  134.          FillColor       =   &H00FFFFFF&
  135.          FillStyle       =   0  'Solid
  136.          Height          =   735
  137.          Index           =   0
  138.          Left            =   120
  139.          Top             =   240
  140.          Width           =   735
  141.       End
  142.       Begin Shape Shape1 
  143.          BorderStyle     =   0  'Transparent
  144.          FillColor       =   &H00FFFFFF&
  145.          FillStyle       =   0  'Solid
  146.          Height          =   735
  147.          Index           =   1
  148.          Left            =   120
  149.          Top             =   960
  150.          Width           =   735
  151.       End
  152.       Begin Shape Shape1 
  153.          BorderStyle     =   0  'Transparent
  154.          FillColor       =   &H00FFFFFF&
  155.          FillStyle       =   0  'Solid
  156.          Height          =   735
  157.          Index           =   2
  158.          Left            =   840
  159.          Top             =   240
  160.          Width           =   735
  161.       End
  162.       Begin Shape Shape1 
  163.          BorderStyle     =   0  'Transparent
  164.          FillColor       =   &H00FFFFFF&
  165.          FillStyle       =   0  'Solid
  166.          Height          =   735
  167.          Index           =   3
  168.          Left            =   840
  169.          Top             =   960
  170.          Width           =   735
  171.       End
  172.       Begin Shape Shape1 
  173.          BorderStyle     =   0  'Transparent
  174.          FillColor       =   &H00FFFFFF&
  175.          FillStyle       =   0  'Solid
  176.          Height          =   735
  177.          Index           =   4
  178.          Left            =   1560
  179.          Top             =   240
  180.          Width           =   735
  181.       End
  182.       Begin Shape Shape1 
  183.          BorderStyle     =   0  'Transparent
  184.          FillColor       =   &H00FFFFFF&
  185.          FillStyle       =   0  'Solid
  186.          Height          =   735
  187.          Index           =   5
  188.          Left            =   1560
  189.          Top             =   960
  190.          Width           =   735
  191.       End
  192.    End
  193.    Begin BmpList BmpList1 
  194.       BorderEffect    =   0  'None
  195.       BorderStyle     =   1  'Fixed Single
  196.       BottomMargin    =   60
  197.       Height          =   2415
  198.       Left            =   240
  199.       MultiSelect     =   0  'None
  200.       Sorted          =   0   'False
  201.       TabIndex        =   0
  202.       Top             =   240
  203.       TopMargin       =   30
  204.       VertGap         =   30
  205.       Width           =   2415
  206.    End
  207.    Begin Label Label1 
  208.       Caption         =   "Item Text:"
  209.       Enabled         =   0   'False
  210.       Height          =   255
  211.       Left            =   2880
  212.       TabIndex        =   12
  213.       Top             =   2040
  214.       Width           =   1215
  215.    End
  216. Dim CurIndex As Integer
  217. Sub BmpList1_Click ()
  218.     Dim I As Integer
  219.     If BmpList1.ListCount = 0 Then
  220.         Command3.Enabled = False
  221.         Exit Sub
  222.     End If
  223.     Command3.Enabled = True
  224.     If CurIndex <> -1 Then
  225.         Picture1(CurIndex).BackColor = &HFFFFFF
  226.         Shape1(CurIndex).FillColor = &HFFFFFF
  227.         CurIndex = -1
  228.     End If
  229.     For I = 0 To 5
  230.         If Picture1(I).Picture = BmpList1.Picture(BmpList1.ListIndex) Then
  231.             CurIndex = I
  232.             Picture1(CurIndex).BackColor = &HC0C0C0
  233.             Shape1(CurIndex).FillColor = &HC0C0C0
  234.             Exit For
  235.         End If
  236.     Next I
  237.     Text1.Text = BmpList1.List(BmpList1.ListIndex)
  238. End Sub
  239. Sub Command1_Click ()
  240.     End
  241. End Sub
  242. Sub Command2_Click ()
  243.     ' BmpList1.ScreenUpdate = False
  244.     BmpList1.AddItem Text1
  245.     BmpList1.Picture(BmpList1.NewIndex) = Picture1(CurIndex).Picture
  246.     BmpList1.ScreenUpdate = True
  247. End Sub
  248. Sub Command3_Click ()
  249.     BmpList1.RemoveItem BmpList1.ListIndex
  250.     If BmpList1.ListCount = 0 Then
  251.         Command3.Enabled = False
  252.         BmpList1.ListIndex = 0
  253.     ElseIf BmpList1.ListIndex >= BmpList1.ListCount Then
  254.         BmpList1.ListIndex = BmpList1.ListCount - 1
  255.     End If
  256. End Sub
  257. Sub Form_Load ()
  258.     CurIndex = -1
  259. End Sub
  260. Sub Picture1_Click (Index As Integer)
  261.     If CurIndex <> -1 Then
  262.         Shape1(CurIndex).FillColor = &HFFFFFF
  263.         Picture1(CurIndex).BackColor = &HFFFFFF
  264.     End If
  265.     If CurIndex = Index Then
  266.         CurIndex = -1
  267.         Command2.Enabled = False
  268.         Label1.Enabled = False
  269.         Text1.Enabled = False
  270.         If BmpList1.ListCount > 0 Then
  271.             BmpList1.Picture(BmpList1.ListIndex) = Null
  272.         End If
  273.     Else
  274.         Command2.Enabled = True
  275.         Text1.Enabled = True
  276.         Label1.Enabled = True
  277.         CurIndex = Index
  278.         Picture1(Index).BackColor = &HC0C0C0
  279.         Shape1(Index).FillColor = &HC0C0C0
  280.         If BmpList1.ListCount > 0 Then
  281.             BmpList1.Picture(BmpList1.ListIndex) = Picture1(Index).Picture
  282.         End If
  283.     End If
  284. End Sub
  285. Sub Text1_Change ()
  286.     If BmpList1.ListCount > 0 Then
  287.         BmpList1.List(BmpList1.ListIndex) = Text1.Text
  288.     End If
  289. End Sub
  290.