Link to home
Start Free TrialLog in
Avatar of power98888
power98888

asked on

C# MDI Child form textbox Ctrl+C not working

Hi,

I have a MDI and a child form.  On the child form, the Ctrl+C not working.
I search lots of solution and find the one on MSDN but not really working.

I put this code in the MDI code but no help, the send message does capture something but
SendMessage may send wrong parameter whatever, no idea how to make it work
I need Ctrl + c, Ctrl + V + Ctrl +x work on the text box in the child form.

Please help.


//I put this code in the MDI code but no help, the send message does capture something but
//SendMessage may send wrong parameter whatever, no idea how to make it work
 
        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
        static extern IntPtr SendMessage(IntPtr hWnd, Int32 Msg, IntPtr wParam, IntPtr lParam);
 
 
        protected override bool ProcessCmdKey(ref Message message, Keys keydata)
        {
            SendMessage(this.ActiveMdiChild.Handle, message.Msg, message.WParam, message.LParam);
            return base.ProcessCmdKey(ref message, keydata);
        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of MRomani
MRomani
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial