Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TreeView/ImageList problem (A 2002 SP 3 (A97))

    A call for help please.

    We have a system which we are upgrading from A97 to A 2002. There is a form for Report Selection which contains a TreeView control, and an ImageList control to display the reports. This runs fine in A97.

    When we try to run it in A 2002 it falls over when the form is loaded. The procedure where it fails is as follows :

    Private Sub fsubSetNodeIcon(ByVal lngNodeKey As Long, fNodeIsReport As Boolean)

    ' Sets the icon of a node.

    Dim strProcOrFunctionName As String

    ...

    Dim objNode As Object
    Set objNode = objTree.Nodes(lngNodeKey)

    objNode.ExpandedImage = mStrcNodeImageOpen

    If fNodeIsReport Then
    objNode.Image = mStrcNodeImageLeaf
    Else
    If objNode.Expanded Then
    objNode.Image = mStrcNodeImageOpen
    Else
    objNode.Image = mStrcNodeImageClosed
    End If
    End If
    objNode.Sorted = True

    Exit_fsubSetNodeIcon:
    Exit Sub

    Err_fsubSetNodeIcon:

    Call msubStandardErrorTrap(gcERROR, gcDETAIL, strcFormOrModuleName, strProcOrFunctionName, Err.Number, Err.Description, vbNullString)
    Resume Exit_fsubSetNodeIcon

    End Sub

    If fails with a 35613 error on the line objNode.ExpandedImage = mStrcNodeImageOpen. mStrcNodeImageOpen is defined as

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 18 Times in 18 Posts

    Re: TreeView/ImageList problem (A 2002 SP 3 (A97))

    Have you set the keys in the new ImageList control? If you haven't, you must use the numeric index of the image instead of the key.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Lewes, East Sussex, Sussex, United Kingdom
    Posts
    227
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TreeView/ImageList problem (A 2002 SP 3 (A97))

    Thank you Hans - that was of course the correct answer.

    If there were awards for Technical Contribution on the Web, yours would be a gold one.

    Thanks again

    Nick

Posting Permissions

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