基于Window消息实现 class TextBoxExt:TextBox { private const int WM_RBUTTONDOWN = 0x0204; private const int WM_CHAR = 0x0102; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_RBUTTONDOWN: return;//屏蔽默认右键菜单 break; case WM_CHAR: int n