BUG: TreeView ToolTips Do Not Appear on Windows NT

Last reviewed: September 18, 1997
Article ID: Q173943
The information in this article applies to:
  • Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 5.0 on the following platform: NT

SYMPTOMS

The ToolTip for a TreeView node does not appear as expected when the node text exceeds the width of the TreeView control. This problem occurs with Windows NT and COMCTL32.OCX version 5.00.3714.

RESOLUTION

To work around this problem, you may use the MouseMove event of the TreeView control to set the ToolTipText of the TreeView control so that it matches the text of the node:

   Private Sub TreeView1_MouseMove(Button As Integer, Shift As Integer, _
       x As Single, y As Single)

       Dim n As Node

       Set n = TreeView1.HitTest(x, y)

       If Not (n Is Nothing) Then
           TreeView1.ToolTipText = n.Text
       Else
           TreeView1.ToolTipText = ""
       End If

   End Sub

You may want to implement this workaround only for users running Windows NT. For information about determining which operating system is in use, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q137032
   TITLE     : HOWTO: Determine Which 32-bit Operating System Is Being Used

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start a new "Standard EXE" project in Visual Basic on Windows NT.

  2. Click Components on the Project menu. Check "Microsoft Windows Common Controls 5.0" and click OK.

  3. Add a TreeView control to Form1.

  4. Add the following code to Form1:

          Private Sub Form_Load()
    

             TreeView1.Width = 2000
             TreeView1.Nodes.Add , , , _
                "This is a line of really, really, really, really long text"
    
          End Sub
    
    

  5. Press the F5 key to start the program. NOTE: The TreeView control should be less than the width of the node text.

  6. Move the cursor over the node. Note that the ToolTip for the node does not appear as expected.
Keywords          : vb5all VBKBAX VBKBComp
Version           : WINDOWS:5.0
Platform          : NT WINDOWS
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.