可以通过捕获控件的WM_PASTE消息实现
参考如下代码:
参考如下代码:
-
C# code
-
public class SubWindow : NativeWindow { protected override void WndProc( ref Message m) { const int WM_PASTE = 0x0302 ; switch (m.Msg) { case WM_PASTE: MessageBox.Show(Clipboard.GetText()); break ; } base .WndProc( ref m); } } private void Form1_Load( object sender, EventArgs e) { SubWindow vSubWindow = new SubWindow(); vSubWindow.AssignHandle(textBox1.Handle); }