home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD90398172000.psc / TestForm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-08-17  |  4.7 KB  |  158 lines

  1. VERSION 5.00
  2. Object = "*\AListBoxOcx.vbp"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Example"
  5.    ClientHeight    =   1815
  6.    ClientLeft      =   2325
  7.    ClientTop       =   3045
  8.    ClientWidth     =   4095
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   121
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   273
  13.    Begin VB.CommandButton Command2 
  14.       Caption         =   "Down"
  15.       Height          =   255
  16.       Left            =   120
  17.       TabIndex        =   6
  18.       Top             =   1440
  19.       Width           =   1215
  20.    End
  21.    Begin VB.CommandButton Command1 
  22.       Caption         =   "Up"
  23.       Height          =   255
  24.       Left            =   120
  25.       TabIndex        =   5
  26.       Top             =   1200
  27.       Width           =   1215
  28.    End
  29.    Begin VB.CommandButton Command3 
  30.       Caption         =   "Clear"
  31.       Height          =   255
  32.       Left            =   120
  33.       TabIndex        =   4
  34.       Top             =   960
  35.       Width           =   1215
  36.    End
  37.    Begin Project2.CustomListBox CustomListBox1 
  38.       Height          =   1575
  39.       Left            =   1440
  40.       TabIndex        =   3
  41.       Top             =   120
  42.       Width           =   2535
  43.       _extentx        =   4471
  44.       _extenty        =   2355
  45.       backcolor       =   16777215
  46.       fontinfo        =   "TestForm.frx":0000
  47.       forecolor       =   16777215
  48.       graphical       =   -1  'True
  49.       picture         =   "TestForm.frx":0028
  50.       scrollbarbackcolor=   12632256
  51.       scrollbarbordercolor=   8421504
  52.       selboxcolor     =   12632064
  53.       sorted          =   0   'False
  54.    End
  55.    Begin VB.CommandButton remove 
  56.       Caption         =   "Remove"
  57.       Height          =   255
  58.       Left            =   120
  59.       TabIndex        =   2
  60.       Top             =   720
  61.       Width           =   1215
  62.    End
  63.    Begin VB.TextBox Text1 
  64.       Height          =   255
  65.       Left            =   120
  66.       TabIndex        =   1
  67.       Text            =   "Some Text"
  68.       Top             =   420
  69.       Width           =   1215
  70.    End
  71.    Begin VB.CommandButton add 
  72.       Caption         =   "Add"
  73.       Height          =   255
  74.       Left            =   120
  75.       TabIndex        =   0
  76.       Top             =   120
  77.       Width           =   1215
  78.    End
  79.    Begin VB.Image Image5 
  80.       Height          =   480
  81.       Left            =   2460
  82.       Picture         =   "TestForm.frx":311A
  83.       Top             =   2040
  84.       Width           =   480
  85.    End
  86.    Begin VB.Image Image4 
  87.       Height          =   480
  88.       Left            =   1860
  89.       Picture         =   "TestForm.frx":39E4
  90.       Top             =   2040
  91.       Width           =   480
  92.    End
  93.    Begin VB.Image Image3 
  94.       Height          =   480
  95.       Left            =   1320
  96.       Picture         =   "TestForm.frx":42AE
  97.       Top             =   2040
  98.       Width           =   480
  99.    End
  100.    Begin VB.Image Image2 
  101.       Height          =   480
  102.       Left            =   780
  103.       Picture         =   "TestForm.frx":4B78
  104.       Top             =   2040
  105.       Width           =   480
  106.    End
  107.    Begin VB.Image Image1 
  108.       Height          =   480
  109.       Left            =   240
  110.       Picture         =   "TestForm.frx":5442
  111.       Top             =   2040
  112.       Width           =   480
  113.    End
  114. Attribute VB_Name = "Form1"
  115. Attribute VB_GlobalNameSpace = False
  116. Attribute VB_Creatable = False
  117. Attribute VB_PredeclaredId = True
  118. Attribute VB_Exposed = False
  119. ' This is just the test form.
  120. Option Explicit
  121. Private Sub Command1_Click()
  122.     CustomListBox1.MoveUp
  123. End Sub
  124. Private Sub add_Click()
  125.     Static PicIndex As Integer
  126.     If Text1.Text = "" Then
  127.         MsgBox "Please enter some text.", vbInformation, "Alert"
  128.         Exit Sub
  129.     End If
  130.     PicIndex = PicIndex + 1
  131.     If PicIndex > 4 Then
  132.         PicIndex = 0
  133.     End If
  134.     CustomListBox1.AddItem Text1.Text, PicIndex
  135.     Text1.Text = ""
  136. End Sub
  137. Private Sub Command2_Click()
  138.     CustomListBox1.Movedown
  139. End Sub
  140. Private Sub Command3_Click()
  141.     CustomListBox1.Clear
  142. End Sub
  143. Private Sub CustomListBox1_DblClick()
  144.     MsgBox "You clicked: " & CustomListBox1.List(CustomListBox1.ListIndex)
  145. End Sub
  146. Private Sub Form_Load()
  147.     ' Add image to use in list
  148.     CustomListBox1.Addimage Image1.Picture ' this will end up being index 0
  149.     CustomListBox1.Addimage Image2.Picture ' index 1
  150.     CustomListBox1.Addimage Image3.Picture ' index 2
  151.     CustomListBox1.Addimage Image4.Picture ' index 3
  152.     CustomListBox1.Addimage Image5.Picture ' index 4
  153. End Sub
  154. Private Sub remove_Click()
  155.     If CustomListBox1.ListIndex = -1 Then Exit Sub
  156.     CustomListBox1.RemoveItem CustomListBox1.ListIndex
  157. End Sub
  158.