本文實例講述了C#禁止textbox復制、粘貼、剪切及鼠標右鍵的方法。分享給大家供大家參考。具體如下:
class MyTextBox : System.Windows.Forms.TextBox{ protected override void WndProc(ref System.Windows.Forms.Message m) { if (m.Msg != 0x007B && m.Msg != 0x0301 && m.Msg != 0x0302) { base.WndProc(ref m); } }}
希望本文所述對大家的C#程序設計有所幫助。
新聞熱點
疑難解答