I have a module that I call to fill upp a listview.
The forms name is f_Meny and the listview's is List1.
Now to my problem:
I want to use the same sub to fill List2 on f_form2, I can't figure out how
I can to that.
Today I must copy the sub and past in it and change little in code and then
it works, but it must be a way to reuse the sub I have.
Here is the sub I want to reuse:
Public Sub lista_List1(ByVal frm As f_Meny)
Dim i As Int32
With frm.List1
.View = View.Details
.Items.Clear()
.Columns.Clear()
.Columns.Add("HsNr", 100, HorizontalAlignment.Left)
.Columns.Add("HsName", 80, HorizontalAlignment.Left)
While DataReader.Read()
.Items.Add(DataReader("HsNr"))
.Items(i).SubItems.Add(DataReader("HsName"))
i = i + 1
End While
End With
ExitHere:
DataReader = Nothing
End Sub
Regars
Kenneth