BUG: AfterLabelEdit Event Fires After Canceling an Edit

ID: Q215388


The information in this article applies to:
  • Microsoft Windows CE Toolkit for Visual Basic 6.0, version 1.0


SYMPTOMS

When using either the Microsoft CE ListView or TreeView control in a Windows CE Toolkit for 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 this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Start a new Windows CE HPC Project. Form1 is created by default.


  2. From the Project menu, choose Components.


  3. Select the Microsoft CE TreeView Control 6.0 to add it to your toolbox.


  4. Place a TreeView control on Form1.


  5. Paste the following code into Form1:


  6. 
    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 
  7. Run the project.


  8. Select the Child node for editing.


  9. Note that the BeforeLabelEdit event fires.

  10. Press the ESC key to cancel the edit.


  11. Note that the AfterLabelEdit event fires. This event should fire only if the label has actually been changed in some fashion.

Additional query words: vbce vbce6 wce wince

Keywords : kbToolkit kbVBp600bug kbWinCE kbGrpVB
Version : WINDOWS:1.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: September 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.