BUG: AfterLabelEdit Event Fires After Canceling an Edit (215388)



The information in this article applies to:

  • Microsoft Windows CE Toolkit for Visual Basic 6.0
  • Microsoft eMbedded Visual C++, Version:4.0

This article was previously published under Q215388

SYMPTOMS

When using either the Microsoft CE ListView or CE TreeView control in either a Windows CE Toolkit for Visual Basic or eMbedded Visual Basic project, the AfterLabelEdit event fires after canceling a label edit. This behavior is not consistent with Visual Basic. This event should fire only if the label has actually been changed in some fashion.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new Windows CE project in either Visual Basic or eMbedded Visual Basic. Form1 is created by default.
  2. From the Project menu, choose Components.
  3. Select the Microsoft CE TreeView Control to add it to your toolbox.
  4. Place a TreeView control on Form1.
  5. Paste the following code into Form1:
    Private Sub Form_Load()
       TreeViewCtl1.LineStyle = tvwRootLines
    
       Dim nodX
       Set nodX = TreeViewCtl1.Nodes.Add(, , "r", "Root")
       Set nodX = TreeViewCtl1.Nodes.Add("r", tvwChild, "child1", "Child")
       TreeViewCtl1.Nodes(2).EnsureVisible
    End Sub
    
    Private Sub TreeViewCtl1_AfterLabelEdit(Cancel As Integer, NewString As String)
        MsgBox "AfterLabelEdit"
    End Sub
    
    Private Sub TreeViewCtl1_BeforeLabelEdit(Cancel As Integer)
        MsgBox "BeforeLabelEdit"
    End Sub
    					
  6. Run the project.
  7. Select the Child node for editing. Note that the BeforeLabelEdit event fires.

  8. Press the ESC key or select the parent node to cancel the edit. Note that the AfterLabelEdit event fires. This event should fire only if the label has actually been changed in some fashion.

Modification Type:MinorLast Reviewed:8/19/2005
Keywords:kbBug kbpending kbToolkit KB215388