.NET Framework - TextBox Paste event

Asked By DaveL on 28-Apr-08 10:49 AM
How do i Capture the Text box Paste event
From the Builtin Context Menu of textbox control

Or do i need to replace the default context menu

TIA
Dave




zack replied on 29-Apr-08 06:36 AM
TextBox.TextChanged maybe?
DaveL replied on 28-Apr-08 02:02 PM
Here is What i Ended up doing....
I needed Clipboard contents before the textbox got ahold of it...to send it
out the com Port
just Inherited Textbox and it worked gr8

DaveL

public class testTextBox:TextBox

{
public MyComClass oCom;
protected override void WndProc(ref Message m)
{


switch(m.Msg)
{
case Win32Constants.WM_PASTE
if (Clipboard.containsText()==true &&
oCom.IsComportOpen())
{
//send out the comport
this.oCom.ComPutString(Clipboard.GetText(),true);
//continue on its merry way to the textbox
base.wndProc(ref m);
}

default:
base.wndProc(ref m);
break;
}
}
}