BUG: TreeView Expand Event Does Not Occur When Using ENTER Key (183332)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q183332 SYMPTOMS
The Expand event of a TreeView control does not occur when the ENTER key is
pressed to expand a node. Although the node actually expands as expected,
the Expand event is not triggered.
CAUSE
This problem only occurs when the mouse is used to collapse the node
(either by clicking the + sign or by double-clicking the node), then the
ENTER key is pressed to expand the node. If the ENTER key is used to both
collapse and expand the node, the problem does not occur.
RESOLUTION
A workaround in Visual Basic 5.0 is to trap for the ENTER key in the
KeyDown event of the TreeView control and then call the Expand event. See
the "Steps to Reproduce Behavior" section below for an example. This
workaround is possible only for Visual Basic 5.0 because the TreeView
control in Visual Basic 4.0 does not allow you to capture the ENTER key in
the KeyDown event of the TreeView control.
For more information, please see the following article in the Microsoft
Knowledge Base:
150200 BUG: TreeView Control Does Not Receive Key Events
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.
Modification Type: | Major | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbbug kbcode kbpending KB183332 |
---|
|