Copy, Cut, Paste not Working in .net 2.0 MDI Application

For years I used to use ctrl-Ins and shift-Ins instead of ctrl-c and ctrl-v.  A couple of years ago I forced myself to switch over to the new “standard.”  Recently, I was forced to revert back to the ctrl-ins and shift-ins in a .net 2.0 MDI application I was working on.  Ctrl-c, ctrl-x, and ctrl-v wouldn’t work.  After a couple of wasted hours, I was able to figure out what was going thanks to some hard-to-find forum posts.  When you put a toolstrip control on the MDI form and let it put the starter menu items in for you, the Edit submenu items have short-cut keys defined for copy, cut and paste.  That seems nice until you realize that it disables those keys in all of your forms and controls.  Worse yet, there’s not really any code you can put in the event handler to make things work the way they should.  I just removed the short-cut keys.

Posted in .net, mdi. 3 Comments »

3 Responses to “Copy, Cut, Paste not Working in .net 2.0 MDI Application”

  1. MaNaNdO Says:

    Had the exact same problem, and could never figure out why copy/paste didn’t work in my app, but it did in other apps.

  2. Sean Coughlin Says:

    I found a workaround by overriding ProcessCmdKey() in the child window, declining to process base(), and selecting the focused control via the HWND and manually copying its value to the clipboard.

  3. lasantha Says:

    Thanks for this. such a tiny thing. lacking of finding out these????kind of a shame :-D :-D :-D

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: