home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
-
- Sub MListItemsResize (mlst As MListBox, ByVal viHeight As Integer)
- Dim i As Integer
-
- ' create an array large enough to hold the contents of the MList
- ReDim msItem(mlst.ListCount - 1) As String
-
- ' copy the items from the MList to the array
- For i = 0 To UBound(msItem)
- msItem(i) = mlst.List(i)
- Next i
-
- mlst.Clear
- ' mlst.Refresh
-
- ' setting the ItemHeight property for an MList
- ' will resize every line in the MList when it is reloaded!
- mlst.AddItemHeight = viHeight
-
- ' now reload the listbox from the array
- For i = 0 To UBound(msItem)
- mlst.AddItem msItem(i)
- Next i
-
- Erase msItem
-
- End Sub
-
-