[Webinar] Learn how to a build a cloud-first strategyRegister Now


Getting Ctrl + v to work on your MDIChild form's Textbox

Posted on 2009-04-27
Medium Priority
Last Modified: 2013-12-17
I need to make the Copy, Paste work on my MDIChild Form's textBox.

On Googling I found that ProcessCmdKey method needs to be overriden on MDI Parent and SendMessage api function needs to be used to let the MDI Parent form forward the keystrokes to the MdiChild form.

When I wired the ProcessCmdKey, the textbox on the MDIChild form stopped taking any keys at all. Can someone please step me through it ?

I just did a little test. I created a different winforms app, with 1 MDI and 1 Child form in it. I put a text box on child form.
I created a user control in the same project and put a text box in it, and than put that user control on the child form.
I ran the app, and loaded the child form through mdi form's Load event.
I copied some text from some other app, and did the "Ctrl + v" on both the text boxes (simple text box and textbox inside the user control), they both worked fine!!

now i am confused, what's really goin on?

I think I didn't give the enough Information before.
My MDI Form is being derived from a BaseForm which is in turn derived from Form class.
I copied BaseForm class to my new test project (which I mentioned above in UPDATE 1) and made my child form and the MDI form derive from this BaseForm, but it still works ok, ie Ctrl + C, Ctrl + V works fine on textbox on child form.

Can someone help me brainstorming with this ?

Question by:DPalkar
1 Comment

Accepted Solution

DPalkar earned 0 total points
ID: 24263102

Well Thanks whoever atleast took a look at this problem.
Because the solution has turned out to be something really obvious and funny.
I had a Menustrip on my MDIForm, everybody does!
But I had a Menu Item called "Edit" with all sub menu items like cut, copy paste etc..(again everybody does)
And these 3 items had the shortcut keys set with Ctrl+x, Ctrl+c, Ctrl+v respectively.
I think that's where the key strokes were being desolved. But it never occured to me because at runtime as well as the designtime (Unless u click on the menu strip) the Edit Menu was invisible.

Well,  It was a good long excercise in the end.
After 2 days of hair snatching, I could atleast give that excuse to myself.

Thanks anyway

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month20 days, 13 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question