Solved

Cut,Copy,Paste in MdiParent Menu

Posted on 2006-06-20
4
430 Views
Last Modified: 2010-04-23
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
Comment
Question by:StanLawrence
  • 2
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
ID: 16942255
Try this:

SendKeys.Send("^x")     ' cut
SendKeys.Send("^c")     ' copy
SendKeys.Send("^v")     ' paste
0
 

Author Comment

by:StanLawrence
ID: 16942669
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
 
LVL 48

Expert Comment

by:AlexFM
ID: 16943317
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
 

Author Comment

by:StanLawrence
ID: 16950698
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

837 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