Microsoft KB Archive/173943

From BetaArchive Wiki

FIX: TreeView ToolTips Do Not Appear on Windows NT

ID: Q173943



The information in this article applies to:


  • Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 5.0

on the following platforms: 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:


Q189249 : 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. This bug has been fixed in Visual Basic 6.0.



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.

Additional query words: kbVBp500bug kbVBp600fix kbVBp kbdsd kbDSupport kbControl

Keywords          : 
Version           : 
Platform          : NT WINDOWS 
Issue type        : kbbug 

Last Reviewed: June 10, 1999