T
Terry
I have a context menu for a ListView in Detail view. The items are
editable. I would like the user to be able to press the "Del" key to remove
items and have a context menu item for the delete function as well. So, I
created a MenuItem and set the "Shortcut" property to "Del".
At this point the user can hit the "Del" button and the items are deleted,
or the user can right-click and select the "Delete items" menu item and the
items are deleted. So far, so good.
The problem is when the user is *editing* an item and then hits the "Del"
key in the edit box to remove characters. I'd expect the edit control to
handle the delete and just remove the character in front of the cursor, but
instead, the MenuItem's delete handler gets fired and removes the item from
the view.
This seems like incorrect behavior to me. If the edit control has focus,
all keystrokes should be handled by the edit box.
How does everyone else deal with this? Just not set MenuItem shortcuts?
Thanks,
Terry
editable. I would like the user to be able to press the "Del" key to remove
items and have a context menu item for the delete function as well. So, I
created a MenuItem and set the "Shortcut" property to "Del".
At this point the user can hit the "Del" button and the items are deleted,
or the user can right-click and select the "Delete items" menu item and the
items are deleted. So far, so good.
The problem is when the user is *editing* an item and then hits the "Del"
key in the edit box to remove characters. I'd expect the edit control to
handle the delete and just remove the character in front of the cursor, but
instead, the MenuItem's delete handler gets fired and removes the item from
the view.
This seems like incorrect behavior to me. If the edit control has focus,
all keystrokes should be handled by the edit box.
How does everyone else deal with this? Just not set MenuItem shortcuts?
Thanks,
Terry