home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / chklst11 / chklist.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  4.5 KB  |  165 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5415
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1515
  7.    ClientWidth     =   5280
  8.    Height          =   5820
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5415
  12.    ScaleWidth      =   5280
  13.    Top             =   1170
  14.    Width           =   5400
  15.    Begin VB.CommandButton Command4 
  16.       Caption         =   "Delete All"
  17.       Height          =   375
  18.       Left            =   960
  19.       TabIndex        =   11
  20.       Top             =   1440
  21.       Width           =   1455
  22.    End
  23.    Begin VB.CommandButton Command2 
  24.       Caption         =   "Delete Selected"
  25.       Height          =   375
  26.       Left            =   2640
  27.       TabIndex        =   8
  28.       Top             =   1440
  29.       Width           =   1455
  30.    End
  31.    Begin VB.TextBox Text4 
  32.       Height          =   285
  33.       Left            =   3360
  34.       TabIndex        =   6
  35.       Text            =   "Text4"
  36.       Top             =   4800
  37.       Width           =   735
  38.    End
  39.    Begin VB.TextBox Text3 
  40.       Height          =   285
  41.       Left            =   3360
  42.       TabIndex        =   4
  43.       Text            =   "Text3"
  44.       Top             =   4320
  45.       Width           =   735
  46.    End
  47.    Begin VB.CheckBox Check1 
  48.       Caption         =   "IsChecked"
  49.       Height          =   255
  50.       Left            =   960
  51.       TabIndex        =   3
  52.       Top             =   4320
  53.       Width           =   1095
  54.    End
  55.    Begin VB.TextBox Text2 
  56.       Height          =   285
  57.       Left            =   960
  58.       TabIndex        =   9
  59.       Text            =   "Text2"
  60.       Top             =   3840
  61.       Width           =   3135
  62.    End
  63.    Begin VB.CommandButton Command3 
  64.       Caption         =   "Add Text && Check"
  65.       Height          =   375
  66.       Left            =   2640
  67.       TabIndex        =   2
  68.       Top             =   960
  69.       Width           =   1455
  70.    End
  71.    Begin VB.CommandButton Command1 
  72.       Caption         =   "Add Text"
  73.       Height          =   375
  74.       Left            =   960
  75.       TabIndex        =   1
  76.       Top             =   960
  77.       Width           =   1455
  78.    End
  79.    Begin VB.TextBox Text1 
  80.       Height          =   285
  81.       Left            =   960
  82.       TabIndex        =   0
  83.       Text            =   "Another Line of text"
  84.       Top             =   600
  85.       Width           =   3135
  86.    End
  87.    Begin CHKLISTLib.ChkList ChkList1 
  88.       Height          =   1335
  89.       Left            =   990
  90.       TabIndex        =   10
  91.       Top             =   2055
  92.       Width           =   3135
  93.       _Version        =   65536
  94.       _ExtentX        =   5530
  95.       _ExtentY        =   2355
  96.       _StockProps     =   13
  97.    End
  98.    Begin VB.Frame Frame1 
  99.       Caption         =   "When Selection Changes"
  100.       Height          =   1575
  101.       Left            =   720
  102.       TabIndex        =   12
  103.       Top             =   3600
  104.       Width           =   3615
  105.    End
  106.    Begin VB.Label Label3 
  107.       Caption         =   "Index"
  108.       Height          =   255
  109.       Left            =   2640
  110.       TabIndex        =   7
  111.       Top             =   4800
  112.       Width           =   615
  113.    End
  114.    Begin VB.Label Label2 
  115.       Caption         =   "Count"
  116.       Height          =   255
  117.       Left            =   2640
  118.       TabIndex        =   5
  119.       Top             =   4320
  120.       Width           =   615
  121.    End
  122. Attribute VB_Name = "Form1"
  123. Attribute VB_Creatable = False
  124. Attribute VB_Exposed = False
  125. Private Sub ChkList1_SelectionChanged(ByVal Index As Integer)
  126. Text2.Text = ChkList1.GetString(Index)
  127. Text3.Text = ChkList1.GetCount
  128. Text4.Text = Index
  129. If ChkList1.IsChecked(Index) = True Then
  130.     Check1.Value = 1
  131.     Check1.Value = 0
  132. End If
  133. End Sub
  134. Private Sub Command1_Click()
  135. ChkList1.AddString (Text1.Text)
  136. End Sub
  137. Private Sub Command2_Click()
  138. Index = ChkList1.GetCurSel
  139. If Index > -1 Then
  140. ChkList1.DeleteItem (Index)
  141. End If
  142. End Sub
  143. Private Sub Command3_Click()
  144. ChkList1.AddStringCheck Text1.Text, True
  145. End Sub
  146. Private Sub Command4_Click()
  147. ChkList1.Clear
  148. End Sub
  149. Private Sub Command5_Click()
  150. n = 0
  151. n = ChkList1.FindString(Text1.Text)
  152. If n > -1 Then
  153. MsgBox (n)
  154. End If
  155. End Sub
  156. Private Sub Form_Load()
  157. For i = 0 To 20
  158.     If i Mod 2 = 0 Then
  159.     ChkList1.AddString "Test Line " + Chr(85 - i)
  160.     Else
  161.     ChkList1.AddStringCheck "Test Line " + Chr(85 - i), True
  162.     End If
  163. Next i
  164. End Sub
  165.