home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / bmp_list / blsample.frm next >
Text File  |  1993-12-16  |  9KB  |  311 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         =   BLSAMPLE.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         =   BLSAMPLE.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         =   BLSAMPLE.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         =   BLSAMPLE.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         =   BLSAMPLE.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         =   BLSAMPLE.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.       ItemHeight      =   600
  199.       ItemPlacement   =   0  'Top
  200.       ItemWidth       =   1800
  201.       Left            =   240
  202.       LeftMargin      =   120
  203.       MultiColumn     =   0   'False
  204.       MultiSelect     =   0  'None
  205.       NumColumns      =   0
  206.       Sorted          =   0   'False
  207.       TabIndex        =   0
  208.       Top             =   240
  209.       TopMargin       =   30
  210.       VertGap         =   30
  211.       Width           =   2415
  212.    End
  213.    Begin Label Label1 
  214.       Caption         =   "Item Text:"
  215.       Enabled         =   0   'False
  216.       Height          =   255
  217.       Left            =   2880
  218.       TabIndex        =   12
  219.       Top             =   2040
  220.       Width           =   1215
  221.    End
  222. End
  223. Dim CurIndex As Integer
  224.  
  225. Sub BmpList1_Click ()
  226.     Dim I As Integer
  227.  
  228.     If BmpList1.ListCount = 0 Then
  229.         Command3.Enabled = False
  230.         Exit Sub
  231.     End If
  232.  
  233.     Command3.Enabled = True
  234.     If CurIndex <> -1 Then
  235.         Picture1(CurIndex).BackColor = &HFFFFFF
  236.         Shape1(CurIndex).FillColor = &HFFFFFF
  237.         CurIndex = -1
  238.     End If
  239.  
  240.     For I = 0 To 5
  241.         If Picture1(I).Picture = BmpList1.Picture(BmpList1.ListIndex) Then
  242.             CurIndex = I
  243.  
  244.             Picture1(CurIndex).BackColor = &HC0C0C0
  245.             Shape1(CurIndex).FillColor = &HC0C0C0
  246.             Exit For
  247.         End If
  248.     Next I
  249.  
  250.     Text1.Text = BmpList1.List(BmpList1.ListIndex)
  251. End Sub
  252.  
  253. Sub Command1_Click ()
  254.     End
  255. End Sub
  256.  
  257. Sub Command2_Click ()
  258.     ' BmpList1.ScreenUpdate = False
  259.     BmpList1.AddItem Text1
  260.     BmpList1.Picture(BmpList1.NewIndex) = Picture1(CurIndex).Picture
  261.     BmpList1.ScreenUpdate = True
  262. End Sub
  263.  
  264. Sub Command3_Click ()
  265.     BmpList1.RemoveItem BmpList1.ListIndex
  266.  
  267.     If BmpList1.ListCount = 0 Then
  268.         Command3.Enabled = False
  269.         BmpList1.ListIndex = 0
  270.     ElseIf BmpList1.ListIndex >= BmpList1.ListCount Then
  271.         BmpList1.ListIndex = BmpList1.ListCount - 1
  272.     End If
  273. End Sub
  274.  
  275. Sub Form_Load ()
  276.     CurIndex = -1
  277. End Sub
  278.  
  279. Sub Picture1_Click (Index As Integer)
  280.     If CurIndex <> -1 Then
  281.         Shape1(CurIndex).FillColor = &HFFFFFF
  282.         Picture1(CurIndex).BackColor = &HFFFFFF
  283.     End If
  284.  
  285.     If CurIndex = Index Then
  286.         CurIndex = -1
  287.         Command2.Enabled = False
  288.         Label1.Enabled = False
  289.         Text1.Enabled = False
  290.     Else
  291.         Command2.Enabled = True
  292.         Text1.Enabled = True
  293.         Label1.Enabled = True
  294.         CurIndex = Index
  295.  
  296.         Picture1(Index).BackColor = &HC0C0C0
  297.         Shape1(Index).FillColor = &HC0C0C0
  298.  
  299.         If BmpList1.ListCount > 0 Then
  300.             BmpList1.Picture(BmpList1.ListIndex) = Picture1(Index).Picture
  301.         End If
  302.     End If
  303. End Sub
  304.  
  305. Sub Text1_Change ()
  306.     If BmpList1.ListCount > 0 Then
  307.         BmpList1.List(BmpList1.ListIndex) = Text1.Text
  308.     End If
  309. End Sub
  310.  
  311.