home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / multi.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-26  |  3.4 KB  |  103 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMulti 
  3.    Caption         =   "Multiple-Column List Box"
  4.    ClientHeight    =   4800
  5.    ClientLeft      =   240
  6.    ClientTop       =   1575
  7.    ClientWidth     =   8310
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   1
  11.       weight          =   700
  12.       size            =   8.25
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    Height          =   5205
  18.    Left            =   180
  19.    LinkTopic       =   "Form2"
  20.    ScaleHeight     =   4800
  21.    ScaleWidth      =   8310
  22.    Top             =   1230
  23.    Width           =   8430
  24.    Begin VB.CommandButton cmdClear 
  25.       Caption         =   "C&lear"
  26.       Height          =   495
  27.       Left            =   6480
  28.       TabIndex        =   4
  29.       Top             =   1440
  30.       Width           =   1215
  31.    End
  32.    Begin VB.CommandButton cmdClose 
  33.       Caption         =   "&Close"
  34.       Height          =   495
  35.       Left            =   6480
  36.       TabIndex        =   3
  37.       Top             =   2760
  38.       Width           =   1215
  39.    End
  40.    Begin VB.CommandButton cmdTransfer 
  41.       Caption         =   "&Transfer"
  42.       Default         =   -1  'True
  43.       Height          =   495
  44.       Left            =   6480
  45.       TabIndex        =   2
  46.       Top             =   600
  47.       Width           =   1215
  48.    End
  49.    Begin VB.ListBox lstBottom 
  50.       Height          =   1590
  51.       Left            =   600
  52.       TabIndex        =   1
  53.       Top             =   2400
  54.       Width           =   5295
  55.    End
  56.    Begin VB.ListBox lstTop 
  57.       Columns         =   2
  58.       Height          =   1590
  59.       Left            =   600
  60.       MultiSelect     =   2  'Extended
  61.       Sorted          =   -1  'True
  62.       TabIndex        =   0
  63.       Top             =   480
  64.       Width           =   5295
  65.    End
  66. Attribute VB_Name = "frmMulti"
  67. Attribute VB_Creatable = False
  68. Attribute VB_Exposed = False
  69. Private Sub cmdClear_Click()
  70.     lstBottom.Clear
  71.     cmdClear.Enabled = False        ' The bottom list is now empty, so disable the Clear button.
  72. End Sub
  73. Private Sub cmdClose_Click()
  74.     Unload Me            ' Unload this form.
  75. End Sub
  76. Private Sub cmdTransfer_Click()
  77.     For n = 0 To (lstTop.ListCount - 1)
  78.         If lstTop.Selected(n) = True Then       ' If selected, then, add to the bottom list.
  79.             lstBottom.AddItem lstTop.List(n)
  80.         End If
  81.     Next
  82.     cmdClear.Enabled = True                     ' An item is now in the bottom list, so enable the Clear button.
  83. End Sub
  84. Private Sub Form_Load()
  85.     ' Note that the Sorted property of lstTop is True, so adding
  86.     ' items in alphabetical order is not actually necessary.
  87.     lstTop.AddItem "Acme Pavers"
  88.     lstTop.AddItem "Belding and Associates"
  89.     lstTop.AddItem "Banyan II, Inc."
  90.     lstTop.AddItem "Feldspar, Feldspar, and Feldspar"
  91.     lstTop.AddItem "Gold Dusters Housecleaning"
  92.     lstTop.AddItem "MS Brothers Bakery"
  93.     lstTop.AddItem "Northwind Traders"
  94.     lstTop.AddItem "Sandor Cinemas"
  95.     lstTop.AddItem "Tastings Catering"
  96.     lstTop.AddItem "Tang and Ng, CPAs"
  97.     lstTop.Selected(0) = True   ' Select a couple of items.
  98.     lstTop.Selected(1) = True
  99. End Sub
  100. Private Sub lstTop_DblClick()
  101.     cmdTransfer.Value = True    ' A user clicked the Transfer button.
  102. End Sub
  103.