Results 1 to 12 of 12

Thread: image for AxMSComctlLib.AxTreeView.Node (SOLVED)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    image for AxMSComctlLib.AxTreeView.Node (SOLVED)

    HI,

    I need to add an image (icon) to the treeview from VB6 using vb.NET.
    I do this in an procedure (formatNode) where I pass the treeview by reference.
    But I always get errors. Can somebody help me with this.

    Code:
    Private Sub formatNode(ByRef control As AxMSComctlLib.AxTreeView)
            With control.Nodes.Item(myNodeCount) 'grab the current node
                .Expanded = True 'expand the node
                '.Image = ????? (please help !!!!)
            End With
        End Sub
    Last edited by R@emdonck; Dec 16th, 2002 at 11:44 AM.

  2. #2
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    you need to place an immage list on a form and assign your images there.

    to change an image for a given row
    Treeview1.SelectedImageIndex = index_of_the_image

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Thumbs down

    the SelectedImageIndex property does not exits in the treeview from VB6 ....

    Sorry

  4. #4
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    why do you post it in .NET forum then?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98
    because I need to use this object in a vb.Net project ...

  6. #6
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    Treeview element in VB.NET DOES HAVE SelectedImageIndex Property!

    Make sure you connect imagelist element to imagelist property of a treeview element

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98
    I tried this, but all I got was another error ...
    "Exception from HRESULT: 0x800A8B1A."

    Code:
    Private Sub formatNode(ByRef control As AxMSComctlLib.AxTreeView, ByRef Images As AxMSComctlLib.AxImageList)
            Try
                control.ImageList = Images
                With control.Nodes.Item(myNodeCount) 'grab the current node
                    .Expanded = True 'expand the node
                    .Image = Images.ListImages.Item(0)
                End With
            Catch
                Dim mes As String
                mes = Err.Description
                MsgBox(mes)
            End Try
        End Sub

  8. #8
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    have a look
    Last edited by klintsovi; Dec 16th, 2002 at 08:01 AM.

  9. #9
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    here

  10. #10
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    got problems attaching a file
    Attached Files Attached Files

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Nice But ...

    Nice but this OK for the TreeView in vb.NET.
    Try the same thing using the VB6 treeview control ....

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    SOLVED

    thanks for all the help ...

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