The method of shielding Ctrl+c in C#

The main implementation method is to rewrite WndProc

public class MyTextBox:TextBox
{
public const int WM_COPY=0x301;
public const int WM_CUT=0x300;
protected overide void WndProc(ref Message m)
{
if (e.Msg==WM_COPY||e.Msg==WM_CUT)return;//Do not process
base.WndProc(ref m);
}
}

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325596791&siteId=291194637