Results 1 to 3 of 3

Thread: Setting listview.volumnheaders within the class

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    40

    Setting listview.volumnheaders within the class

    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

  2. #2
    Addicted Member rikshawdriver's Avatar
    Join Date
    Apr 2001
    Posts
    160
    Insetead of

    Code:
    .ColumnHeaders.Add = "Testing"
    use

    Code:
    .ColumnHeaders.Add  "Testing"
    Thomas

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    40
    Sorry,

    It doesn't work, error says : 'type mismatch'

    I have this problems on some other places on the class.
    The funny thing is that, I can set the properties as shown on the code example, but it does not let me execute a method.

    Have ever you experinced this problems before ?


    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width