110,538
社区成员
发帖
与我相关
我的任务
分享
protected override void DefWndProc(ref Message m)
{
switch((UInt32)m.Msg)
{
case WM_CHAR:
case WM_SYSCHAR:
int a=int)int)m.WParam;
if(a==0x61)
{
//在此如何实现啊?
m.Result=(IntPtr)1;
}
default:
m.Result=(IntPtr)1;
break;
}
}
public class NewRich : System.Windows.Forms.RichTextBox
{
const UInt32 WM_CHAR = 0x0102;
const UInt32 WM_SYSCHAR = 0x0106;
protected override void DefWndProc(ref System.Windows.Forms.Message m)
{
switch (UInt32.Parse(m.Msg.ToString()))
{
case WM_CHAR:
case WM_SYSCHAR:
int nParam = (int)m.WParam;
this.Text = "您录入了:" + ((char)nParam).ToString();
m.Result = (IntPtr)1;
break;
default:
m.Result = (IntPtr)1;
break;
}
base.DefWndProc(ref m);
}
}