I try to add a column to listview.columnheaders from within the class, but VB would not allowed to do it.


Vb would not execute line : .ColumnHeaders.Add = "Testing"

There is error said : 'Object does not support this properties or method.'

It is very strange, because I have alredady reference it.



--Main Code---------------

Private Sub Form_Load()

Dim daftarSupplier as New ClassExample

Set daftarSupplier.ListView = ListView1

daftarSupplier.SetListViewProp

End Sub




--ClassExample Code-----------------

Public Property Set ListView(ByVal vData As Object)
Set mvarListView = vData
End Property

Public Property Get ListView() As Object
Set ListView = mvarListView
End Property

-------------------------------------------------

Public Sub SetListViewProp()

With mvarListView
.View = lvwReport
.LabelEdit = lvwManual
.GridLines = True
.FullRowSelect = True
.ColumnHeaders.Add = "Testing" --------> Error
.ColumnHeaders(1).Width = 200
End With

End Sub