Results 1 to 3 of 3
  • Thread Tools
  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. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 13 Times in 13 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.

  4. 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
  •