Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 457
  • Last Modified:

Cut,Copy,Paste in MdiParent Menu

Hi,

Thanks for clicking

I have a parent mdiwindow that has the standard microsoft menubar at the top

Under Edit we have Cut, Copy, Paste

Have downloaded several demo's, but they are either vb6 or simply copy from one textbox to another. (i.e. the code is specific to the textbox)

Need the code that will copy, cut and paste independent of which control on whichever form is highlighted

Realise that it has something to do with Dim DataObject As System.Windows.Forms.IDataObject = System.Windows.Forms.Clipboard.GetDataObject()

but just having trouble putting it altogether

Can anyone help?? I'd be so grateful
0
StanLawrence
Asked:
StanLawrence
  • 2
  • 2
1 Solution
 
AlexFMCommented:
Try this:

SendKeys.Send("^x")     ' cut
SendKeys.Send("^c")     ' copy
SendKeys.Send("^v")     ' paste
0
 
StanLawrenceAuthor Commented:
Hi AlexFM,

Thanks for replying,

That doesn't seem to work. Think it might be due to focus moving to the Cut,Copy ,Paste buttons that are programmed with above.

Any other ideas??
0
 
AlexFMCommented:
I tested this with single form with menu and two text boxes, it worked. If it doesn't work in your case, you need something else.
0
 
StanLawrenceAuthor Commented:
Hi AlexFM,

Upon revisiting, we realised our silly error.

Was due to using Button on the form in question, rather than menuitems

And was doing SendKeys.Send("^x) rather than capital X

Thanks very much for your help on this issue.

Realise it's a small solution, but the 250 points is well worth it to us since could have done round in circles for ever.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now