Re: Cut, Copy and Paste?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Ben R." <benr@xxxxxxxxxxxxxxxx> wrote in message
news:474C8833-3433-4BF4-8284-CA878E67F340@xxxxxxxxxxxxxxxx
Hi,

I've got a vb.net winforms app. Out of the box, I can use Ctrl X, C and V
as
expected in controls like textboxes. I've got a menustrip, and if I click
the
link "Add standard items" which adds Cut copy and paste commands, this
functionality no longer works. It seems now I need to implement handlers
for
these functions. I tried to do so, but say the paste handler, I need to
call
paste on a specific control and that isn't necessarily where the insertion
point is (could be a completely different control). Needless to say, this
functinoality works much better without these menu items. What's going on
here? Are users supposed to implement their own cut copy paste functions?
If
so, how can I make them work regardless of which control I'm working in at
the time?

I'm not sure I know what you mean by making "them work regardless of which
control I'm working in at the time."

The Paste operation is something you want to make universal to all forms and
all text-like objects on the forms. Normal operation is to insert the
contents of the Clipboard into whatever form and whatever object on the form
has focus at the point where the cursor is located (or the stuff that is
selected).

Determining the active form and object can be done from the parent using
Me.ActiveForm.ActiveObject.

The Clipboard.GetText (et al) will retrieve the contents of the Clipboard.

So from the parent you could do something as simple as
Me.ActiveForm.ActiveObject = Clipboard.GetText. If the Clipboard contains a
mixed bag of goods (text with embedded OLE objects, for example) you'll have
to work on a more involved solution.


.



Relevant Pages

  • Re: Praising Opera 9
    ... A feature that was introduced in Netscape, ... If I have the text "I love cookies" in the clipboard and I middle ... The idea is that you would do this for URIs, ... in older Operas) to get the same functionality these days. ...
    (Ubuntu)
  • Re: Getting Rid of Clipbook/board
    ... Do you understand that EVERY SINGLE TIME you cut and paste, ... You are using that invisible Clipboard? ... functionality in your system. ... Ctrl C and then Ctrl V in a day/ in an HOUR! ...
    (microsoft.public.windowsxp.general)
  • turn off office clipbaord functionality completely?
    ... Is there any way to turn office clipboard (multi-copy-paste) ... still keeps collecting in the background. ... this functionality, or is there a better way to get rid of it? ...
    (microsoft.public.office.misc)
  • Re: Multiple clipboards?
    ... > Is it possible to save clipboard text separate from windows main ... > functionality found in answers.com's word lookup application (I'm guessing ...
    (microsoft.public.vb.general.discussion)
  • Re: Subclass a CRichEditCtrl, having trouble overriding OnNotify()
    ... The ON_NOTIFY_REFLECT_EX is useful if you want to extend the functionality transparently ... But I don't want to preclude the parent seeing this, ... or want total control. ... If you want to be transparent, or conditionally transparent, use ...
    (microsoft.public.vc.mfc)