本文實(shí)例講述了C#禁止textbox復(fù)制、粘貼、剪切及鼠標(biāo)右鍵的方法。分享給大家供大家參考。具體如下:
1
2
3
4
5
6
7
8
9
10
|
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); } } } |
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。