G
Guest
I have this sub to resize a listbox:
Sub ResizeListBox()
Dim lineCount As Integer = 0
Dim li As ListItem
For Each li In Me.lstStatus.Items
lineCount += 1
Next li
Me.lstStatus.Rows = lineCount
End Sub
Right now the listbox name is hardcoded. To make it more generic and
reusable, I want to put it in a class and pass any listbox to it.
How do I modify the code to do this?
Thanks much
Sub ResizeListBox()
Dim lineCount As Integer = 0
Dim li As ListItem
For Each li In Me.lstStatus.Items
lineCount += 1
Next li
Me.lstStatus.Rows = lineCount
End Sub
Right now the listbox name is hardcoded. To make it more generic and
reusable, I want to put it in a class and pass any listbox to it.
How do I modify the code to do this?
Thanks much