Re: Cut, Copy and Paste?
- From: "MyndPhlyp" <nobody@xxxxxxxxxxxxx>
- Date: Thu, 20 Jul 2006 16:14:24 -0400
"Ben R." <benr@xxxxxxxxxxxxxxxx> wrote in message
news:474C8833-3433-4BF4-8284-CA878E67F340@xxxxxxxxxxxxxxxx
Hi,as
I've got a vb.net winforms app. Out of the box, I can use Ctrl X, C and V
expected in controls like textboxes. I've got a menustrip, and if I clickthe
link "Add standard items" which adds Cut copy and paste commands, thisfor
functionality no longer works. It seems now I need to implement handlers
these functions. I tried to do so, but say the paste handler, I need tocall
paste on a specific control and that isn't necessarily where the insertionIf
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?
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.
.
- Prev by Date: Re: VB.NET Menubar
- Next by Date: Re: Validating all controls on "Save"
- Previous by thread: Re: deploy window application
- Next by thread: Re: Cut, Copy and Paste?
- Index(es):
Relevant Pages
|