how to react to CTRL+V in TextArea?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to immediately do something when someone pastes something using CTRL+V
into my TextArea... isn't there a specific event I can handle for this? Or do
I have to do a keyboard event and check for those keys? If so, then won't the
event trigger BEFORE the text is actually pasted? I need to use the pasted
text in my event...
 
Hello MrNobody,

Add KeyDown handler for your text area and use code below

private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode==Keys.V)
{
MessageBox.Show("pasted");
}
}

M> I want to immediately do something when someone pastes something
M> using CTRL+V into my TextArea... isn't there a specific event I can
M> handle for this? Or do I have to do a keyboard event and check for
M> those keys? If so, then won't the event trigger BEFORE the text is
M> actually pasted? I need to use the pasted text in my event...
M>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top