home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / actext_1 / frmtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-06-03  |  7.1 KB  |  250 lines

  1. VERSION 5.00
  2. Object = "{20684719-19C6-11D3-855A-444553540000}#1.0#0"; "ACTextBoxSW.ocx"
  3. Begin VB.Form frmTest 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Test Auto-Complete Text Box"
  6.    ClientHeight    =   4380
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5670
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4380
  14.    ScaleWidth      =   5670
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton Command5 
  17.       Caption         =   "Show List"
  18.       Height          =   285
  19.       Left            =   4560
  20.       TabIndex        =   13
  21.       Top             =   1560
  22.       Width           =   975
  23.    End
  24.    Begin VB.TextBox Text4 
  25.       Height          =   2685
  26.       Left            =   120
  27.       MultiLine       =   -1  'True
  28.       ScrollBars      =   3  'Both
  29.       TabIndex        =   12
  30.       Top             =   1560
  31.       Width           =   4335
  32.    End
  33.    Begin VB.CommandButton Command4 
  34.       Caption         =   "Clear All"
  35.       Height          =   285
  36.       Left            =   3720
  37.       TabIndex        =   5
  38.       Top             =   840
  39.       Width           =   975
  40.    End
  41.    Begin VB.TextBox Text3 
  42.       Height          =   285
  43.       Left            =   1080
  44.       TabIndex        =   6
  45.       Top             =   1200
  46.       Width           =   3375
  47.    End
  48.    Begin VB.CommandButton Command3 
  49.       Caption         =   "Add"
  50.       Height          =   285
  51.       Left            =   4560
  52.       TabIndex        =   7
  53.       Top             =   1200
  54.       Width           =   975
  55.    End
  56.    Begin VB.TextBox Text2 
  57.       Height          =   285
  58.       Left            =   2040
  59.       TabIndex        =   3
  60.       Text            =   "1"
  61.       Top             =   840
  62.       Width           =   495
  63.    End
  64.    Begin VB.CommandButton Command1 
  65.       Caption         =   "Show"
  66.       Height          =   285
  67.       Left            =   2640
  68.       TabIndex        =   4
  69.       Top             =   840
  70.       Width           =   975
  71.    End
  72.    Begin VB.CommandButton Command2 
  73.       Caption         =   "Exist?"
  74.       Height          =   285
  75.       Left            =   4560
  76.       TabIndex        =   2
  77.       Top             =   480
  78.       Width           =   975
  79.    End
  80.    Begin VB.TextBox Text1 
  81.       Height          =   285
  82.       Left            =   2040
  83.       TabIndex        =   1
  84.       Text            =   "Computer"
  85.       Top             =   480
  86.       Width           =   2415
  87.    End
  88.    Begin WLACTextBoxSW.ACTextBoxSW ACTextBox1 
  89.       Height          =   255
  90.       Left            =   1080
  91.       TabIndex        =   0
  92.       Top             =   120
  93.       Width           =   4455
  94.       _ExtentX        =   7858
  95.       _ExtentY        =   450
  96.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  97.          Name            =   "MS Sans Serif"
  98.          Size            =   8.25
  99.          Charset         =   0
  100.          Weight          =   400
  101.          Underline       =   0   'False
  102.          Italic          =   0   'False
  103.          Strikethrough   =   0   'False
  104.       EndProperty
  105.    End
  106.    Begin VB.Label Label1 
  107.       Caption         =   "Add Item"
  108.       Height          =   255
  109.       Index           =   3
  110.       Left            =   120
  111.       TabIndex        =   11
  112.       Top             =   1200
  113.       Width           =   735
  114.    End
  115.    Begin VB.Label Label1 
  116.       Caption         =   "Show the N item in the list"
  117.       Height          =   255
  118.       Index           =   2
  119.       Left            =   120
  120.       TabIndex        =   10
  121.       Top             =   840
  122.       Width           =   2175
  123.    End
  124.    Begin VB.Label Label1 
  125.       Caption         =   "Test if Text exists in list"
  126.       Height          =   255
  127.       Index           =   1
  128.       Left            =   120
  129.       TabIndex        =   9
  130.       Top             =   480
  131.       Width           =   1815
  132.    End
  133.    Begin VB.Label Label1 
  134.       Caption         =   "Type Here"
  135.       Height          =   255
  136.       Index           =   0
  137.       Left            =   120
  138.       TabIndex        =   8
  139.       Top             =   120
  140.       Width           =   1215
  141.    End
  142. Attribute VB_Name = "frmTest"
  143. Attribute VB_GlobalNameSpace = False
  144. Attribute VB_Creatable = False
  145. Attribute VB_PredeclaredId = True
  146. Attribute VB_Exposed = False
  147. Option Explicit
  148. Private Sub Command1_Click()
  149.     MsgBox ACTextBox1.List(Text2)
  150. End Sub
  151. Private Sub Command2_Click()
  152.     Dim i As Integer
  153.     'Use Exists function to test if an item exists in the ACTextBox's list
  154.     'Return 0 if item not found, else return the item's position
  155.     i = ACTextBox1.Exists(Text1)
  156.     MsgBox IIf(i = 0, "Item not found", "Item is in position " & i)
  157. End Sub
  158. Private Sub Command3_Click()
  159.     ACTextBox1.Add Text3
  160. End Sub
  161. Private Sub Command4_Click()
  162.     'Clear all items from the list
  163.     ACTextBox1.Clear
  164. End Sub
  165. Private Sub Command5_Click()
  166.     Dim i As Integer
  167.     Dim s As String
  168.     'Show all items
  169.     With ACTextBox1
  170.         For i = 1 To .ListCount
  171.             s = s & .List(i) & vbCrLf
  172.         Next i
  173.     End With
  174.     Text4 = s
  175. End Sub
  176. Private Sub Form_Load()
  177.     With ACTextBox1
  178.         'Use Add method to add an item to the ACTextBox's list, duplicate item and
  179.         'item with length less than or equal to one will not be added without
  180.         'generating an error
  181.         
  182.         'Shareware Version has a limit of maximum 15 items in the list,
  183.         'registered Version doesn't has this limit.
  184.         'Items exceed this limit in shareware version will not be added to the list
  185.         'without generating an error
  186.         .Add "Last Edited Record"
  187.         .Add "Last Chirstmas"
  188.         .Add "Hello"
  189.         .Add "Visual Basic"
  190.         .Add "Visial C++"
  191.         .Add "Visual Fox Pro"
  192.         .Add "Computer"
  193.         .Add "Pentium"
  194.         .Add "How are you"
  195.         .Add "Apple"
  196.         .Add "Add"
  197.         .Add "If"
  198.         .Add "If then else"
  199.         .Add "Game Boy"
  200.         .Add "One"
  201.         .Add "Two"
  202.         .Add "Three"
  203.         .Add "Four"
  204.         .Add "Quennie"
  205.         .Add "Five"
  206.         .Add "Six"
  207.         .Add "Seven"
  208.         .Add "Eight"
  209.         .Add "Nine"
  210.         .Add "Ten"
  211.         .Add "Eleven"
  212.         .Add "Twelve"
  213.         .Add "Thirteen"
  214.         .Add "Fourteen"
  215.         .Add "Fifteen"
  216.         .Add "Sixteen"
  217.         .Add "Seventeen"
  218.         .Add "Eighteen"
  219.         .Add "Ninteen"
  220.         .Add "Twenty"
  221.         .Add "Thirty"
  222.         .Add "Fourty"
  223.         .Add "Fifty"
  224.         .Add "Sixty"
  225.         .Add "Seventy"
  226.         .Add "Eighty"
  227.         .Add "Ninety"
  228.         .Add "Hundred"
  229.         .Add "Thousand"
  230.         .Add "Million"
  231.         .Add "Easy"
  232.         .Add "Cat"
  233.         .Add "Last"
  234.         .Add "Dog"
  235.         .Add "Tiger"
  236.         .Add "Fish"
  237.         .Add "Pen"
  238.         .Add "Monitor"
  239.         .Add "Keyboard"
  240.         .Add "Mouse"
  241.         .Add "Ship"
  242.         .Add "Sheep"
  243.         .Add "Knife"
  244.         .Add "Ghost"
  245.         .Add "Ghost Buster"
  246.         .Add "File"
  247.         .Add "Why"
  248.     End With
  249. End Sub
  250.