home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l406 / 1.ddi / MULTI.FR_ / MULTI.bin (.txt)
Encoding:
Visual Basic Form  |  1992-10-21  |  2.7 KB  |  86 lines

  1. VERSION 2.00
  2. Begin Form frmMulti 
  3.    Caption         =   "Multi-column List Box"
  4.    Height          =   5220
  5.    Left            =   600
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   4815
  8.    ScaleWidth      =   8295
  9.    Top             =   1155
  10.    Width           =   8415
  11.    Begin CommandButton cmdClear 
  12.       Caption         =   "C&lear"
  13.       Height          =   495
  14.       Left            =   6480
  15.       TabIndex        =   4
  16.       Top             =   1440
  17.       Width           =   1215
  18.    End
  19.    Begin CommandButton cmdClose 
  20.       Caption         =   "&Close"
  21.       Height          =   495
  22.       Left            =   6480
  23.       TabIndex        =   3
  24.       Top             =   2760
  25.       Width           =   1215
  26.    End
  27.    Begin CommandButton cmdTransfer 
  28.       Caption         =   "&Transfer"
  29.       Default         =   -1  'True
  30.       Height          =   495
  31.       Left            =   6480
  32.       TabIndex        =   2
  33.       Top             =   600
  34.       Width           =   1215
  35.    End
  36.    Begin ListBox lstBottom 
  37.       Height          =   1590
  38.       Left            =   600
  39.       TabIndex        =   1
  40.       Top             =   2400
  41.       Width           =   5295
  42.    End
  43.    Begin ListBox lstTop 
  44.       Columns         =   2
  45.       Height          =   1590
  46.       Left            =   600
  47.       MultiSelect     =   2  'Extended
  48.       TabIndex        =   0
  49.       Top             =   480
  50.       Width           =   5295
  51.    End
  52. Sub cmdClear_Click ()
  53.     lstBottom.Clear
  54.     cmdClear.Enabled = False        ' Bottom list now empty, so disable Clear button.
  55. End Sub
  56. Sub cmdClose_Click ()
  57.    Unload Me    ' Unload this form.
  58. End Sub
  59. Sub cmdTransfer_Click ()
  60.     For n = 0 To (lstTop.ListCount - 1)
  61.         If lstTop.Selected(n) = True Then       ' If selected, then
  62.             lstBottom.AddItem lstTop.List(n)    ' add to bottom list.
  63.         End If
  64.     Next
  65.     cmdClear.Enabled = True     ' Something now in bottom list, so enable Clear button.
  66. End Sub
  67. Sub Form_Load ()
  68. ' Note that Sorted property of lstTop is True, so adding
  69. ' items in alphabetical order is not actually necessary.
  70.     lstTop.AddItem "Acme Pavers"
  71.     lstTop.AddItem "Belding and Associates"
  72.     lstTop.AddItem "Banyan II, Inc."
  73.     lstTop.AddItem "Feldspar, Feldspar, and Feldspar"
  74.     lstTop.AddItem "Gold Dusters Housecleaning"
  75.     lstTop.AddItem "MS Brothers Bakery"
  76.     lstTop.AddItem "Northwind Traders"
  77.     lstTop.AddItem "Sandor Cinemas"
  78.     lstTop.AddItem "Tastings Catering"
  79.     lstTop.AddItem "Tang and Ng, CPAs"
  80.     lstTop.Selected(0) = True   ' Select a couple of items
  81.     lstTop.Selected(1) = True   ' as a suggestion.
  82. End Sub
  83. Sub lstTop_DblClick ()
  84.     cmdTransfer.Value = True    ' Press Transfer button.
  85. End Sub
  86.