473,788 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy Paste Function

BD
I would like to use the keyboard shortcut 'ctrl + v' to paste from the
clipboard. I can't seem to figure out how to capture the keyboard
input to accomplish this. Any help is greatly appreciated.

Thanks,

BD
Apr 8 '08 #1
6 2920
What are you pasting to? I believe Ctrl-V works for textual input on
controls that include such.

-Drew

"BD" <bw******@chart er.netwrote in message
news:88******** *************** ***********@m71 g2000hse.google groups.com...
>I would like to use the keyboard shortcut 'ctrl + v' to paste from the
clipboard. I can't seem to figure out how to capture the keyboard
input to accomplish this. Any help is greatly appreciated.

Thanks,

BD
Apr 9 '08 #2
In an inherited control you usually override ProcessCmdKey and check the
input and clipboard there.

/claes

"BD" <bw******@chart er.netwrote in message
news:88******** *************** ***********@m71 g2000hse.google groups.com...
>I would like to use the keyboard shortcut 'ctrl + v' to paste from the
clipboard. I can't seem to figure out how to capture the keyboard
input to accomplish this. Any help is greatly appreciated.

Thanks,

BD

Apr 9 '08 #3
BD
On Apr 9, 4:45 am, "Claes Bergefall" <claes.bergef.. .@nospam.nospam >
wrote:
In an inherited control you usually override ProcessCmdKey and check the
input and clipboard there.

/claes

"BD" <bwald...@chart er.netwrote in message

news:88******** *************** ***********@m71 g2000hse.google groups.com...
I would like to use the keyboard shortcut 'ctrl + v' to paste from the
clipboard. I can't seem to figure out how to capture the keyboard
input to accomplish this. Any help is greatly appreciated.
Thanks,
BD
That is what I thought. I would have to process a keydown event and
link it to a keypress event without typing the letter v. How would I
code for that?
Apr 9 '08 #4
BD
On Apr 9, 1:18 am, "DrewCE" <moc.sgodniahc@ werd - backwardswrote:
What are you pasting to? I believe Ctrl-V works for textual input on
controls that include such.

-Drew

"BD" <bwald...@chart er.netwrote in message

news:88******** *************** ***********@m71 g2000hse.google groups.com...
I would like to use the keyboard shortcut 'ctrl + v' to paste from the
clipboard. I can't seem to figure out how to capture the keyboard
input to accomplish this. Any help is greatly appreciated.
Thanks,
BD
I am pasting to multi-line textbox control.
Apr 9 '08 #5

"BD" <bw******@chart er.netwrote in message
news:fa******** *************** ***********@m73 g2000hsh.google groups.com...
On Apr 9, 4:45 am, "Claes Bergefall" <claes.bergef.. .@nospam.nospam >
wrote:
>In an inherited control you usually override ProcessCmdKey and check the
input and clipboard there.

/claes

"BD" <bwald...@chart er.netwrote in message

news:88******* *************** ************@m7 1g2000hse.googl egroups.com...
>I would like to use the keyboard shortcut 'ctrl + v' to paste from the
clipboard. I can't seem to figure out how to capture the keyboard
input to accomplish this. Any help is greatly appreciated.
Thanks,
BD

That is what I thought. I would have to process a keydown event and
link it to a keypress event without typing the letter v. How would I
code for that?
Uhm, no you don't, KeyDown is enough.

private void control_KeyDown (object sender, KeyEventArgs e)
{
if(e.Control && e.KeyCode == Keys.V)
{
//Do your stuff here
}
}

So I'm guessing that this is not in an inherited control then but rather
from any general control?

/claes
Apr 10 '08 #6
BD
On Apr 10, 4:46 am, "Claes Bergefall" <claes.bergef.. .@nospam.nospam >
wrote:
"BD" <bwald...@chart er.netwrote in message

news:fa******** *************** ***********@m73 g2000hsh.google groups.com...
On Apr 9, 4:45 am, "Claes Bergefall" <claes.bergef.. .@nospam.nospam >
wrote:
In an inherited control you usually override ProcessCmdKey and check the
input and clipboard there.
/claes
"BD" <bwald...@chart er.netwrote in message
>news:88******* *************** ************@m7 1g2000hse.googl egroups.com...
I would like to use the keyboard shortcut 'ctrl + v' to paste from the
clipboard. I can't seem to figure out how to capture the keyboard
input to accomplish this. Any help is greatly appreciated.
Thanks,
BD
That is what I thought. I would have to process a keydown event and
link it to a keypress event without typing the letter v. How would I
code for that?

Uhm, no you don't, KeyDown is enough.

private void control_KeyDown (object sender, KeyEventArgs e)
{
if(e.Control && e.KeyCode == Keys.V)
{
//Do your stuff here
}

}

So I'm guessing that this is not in an inherited control then but rather
from any general control?

/claes
Sorry for replying so late, my visual studio crashed. Yes it is just
a general control (multi line textbox). What I was trying to do was
ctrl-C from another program (say email) and do ctrl-v in my C#
application. I will try the above. I was successful at trapping the
ctrl key and pasting but that breaks routine for what is generally
done. Don't want to confuse my users any more than they are, ha ha.

Brian
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
27718
by: The Flyer | last post by:
Hi Sorry for posting this message to so many groups, but I was not sure which group the windows keyboard experts would be reading, so I ventured to post it to all of them. I want to map or create shortcut on the keyboard for Cut/Copy/Paste functions. I can use the regular Control_X, C or V to do the same in Windows XP, but I would rather press a single key just like in Sun Solaris keyboards which have specific keys for these functions.
4
21626
by: Legendary Pansy | last post by:
I was checking out the 101 C# Samples, specifically Windows Forms - Use the Clipboard. I took a look at the code for a while, and I understand what the program is doing with the cut, copy, pasting via the file menu events using the clipboard. However, what I don't get is how is the program able to produce a context menu in the textbox area. When right clicking, the context pops up and allows to cut/copy/paste/delete, etc.. But the thing is, I...
2
35224
by: Mansi | last post by:
I'm trying to automate excel from c#. One of the things I need to do is to copy/paste/insert rows in excel via c# code. I tried to do the following: 1) Select a row in excel (a12 to k12) 2) Insert a row. 3) copy contents of a12 to k12. 4) Paste these contents to new row. The "Record Macro" function returns the following code:
2
1565
by: Max81 | last post by:
Im trying to build a calculator for an assignment! (due wednesday) im having trouble finding any code for creating Copy/Paste menu buttons (just need the "doing" code) can anyone help? in addition, how do you get the keyboard numbers to activate the "calculator" buttons. (not as important)
7
11641
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
8
2616
by: serge calderara | last post by:
Dear all, I have an treeview control with different node object, I would like to implement the Copy/Paste function of an object . For that I am using the folowing function to copy teh object to clipboard : ====> Private Sub CopyToClipboard(ByVal Obj As PluginApp.PlugInReport) ' Creates a new data format.
2
4466
by: al_johnson222 | last post by:
>From any page, I want to be able to call a JS function that will do the equivelant of select all, and copy. This data will then be posted to a page that will log it. This would be easy using copy/paste functionality but I don't want to screw-up users copy/paste buffer. Anyone have an example of how to retrieve all text with similar formatting of copying page to notepad without using copy/paste functionality? Thanks in advance. Al
18
9635
by: Archanak | last post by:
Hi, I have a text box and should allow user to type the text but not to allow them to copy/paste or right click. Here is the code. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title>
5
3878
by: Jock | last post by:
My purchase order system sequentially added the next number to the new order when I clicked the macro button set up with copy/paste functions and it worked well. I cannot do this now as 2007 does not offer these macro functions. My system simply looked at the last record copied the number in the field - opened a new record and pasted the number+1. I cannot use the autonumber function because if a record is raised and then not proceeded...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10112
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.