Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

I don't understand MenuItem.Shortcut

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry - 21 Jul 2004 20:30 GMT
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
Sijin Joseph - 22 Jul 2004 12:30 GMT
Imagine if you had a save context menu item with a shortcut of say Ctrl-S
wouldn't you want a user who is editing to be able to press Ctrl-S to save
the data? or would you rather prefer that only edit functions be available
until he leaves edit mode?

Signature

-Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> 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
[quoted text clipped - 18 lines]
> Thanks,
> Terry

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.