BUG: eVB: TreeView: Showing Form on NodeClick Event Displays It Behind Active Form (261940)
The information in this article applies to:
- Microsoft eMbedded Visual Basic 3.0
This article was previously published under Q261940 SYMPTOMS
If you have a project that contains a TreeView control and you show a form in the NodeClick event of the TreeView control, the form that is shown appears behind the form that contains the TreeView control.
CAUSE
After the new form is loaded, the TreeView control fires its GotFocus event. This causes the form that contains the control to get the focus.
RESOLUTION
To work around this problem, set the Enabled property of the TreeView control to False in the NodeClick event before showing the other Form, and then reset the Enabled property to True in the Form_Activate event. Replace the code in the sample under "Steps to Reproduce Behavior" later in this article with the following:
Option Explicit
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Form_Activate()
TreeViewCtl1.Enabled = True
End Sub
Private Sub Form_Load()
TreeViewCtl1.Nodes.Add , , , "Node One"
TreeViewCtl1.Nodes.Add , , , "Node Two"
End Sub
Private Sub TreeViewCtl1_NodeClick(ByVal Index As Long)
TreeViewCtl1.Enabled = False
Form2.Show
End Sub
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCES262520 BUG: eVB: NodeClick Event Fires the First Time TreeView Control Gets Focus
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kbBug kbDSupport KB261940 |
---|
|