home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / mlist460.zip / MLIST.BAS < prev    next >
BASIC Source File  |  1995-09-04  |  715b  |  30 lines

  1. Option Explicit
  2.  
  3. Sub MListItemsResize (mlst As MListBox, ByVal viHeight As Integer)
  4.     Dim i As Integer
  5.  
  6.     ' create an array large enough to hold the contents of the MList
  7.     ReDim msItem(mlst.ListCount - 1) As String
  8.  
  9.     ' copy the items from the MList to the array
  10.     For i = 0 To UBound(msItem)
  11.         msItem(i) = mlst.List(i)
  12.     Next i
  13.     
  14.     mlst.Clear
  15. '    mlst.Refresh
  16.  
  17.     ' setting the ItemHeight property for an MList
  18.     ' will resize every line in the MList when it is reloaded!
  19.     mlst.AddItemHeight = viHeight
  20.  
  21.     ' now reload the listbox from the array
  22.     For i = 0 To UBound(msItem)
  23.         mlst.AddItem msItem(i)
  24.     Next i
  25.     
  26.     Erase msItem
  27.  
  28. End Sub
  29.  
  30.