wndproc是TWincontrol的ptrotected,不能这样访问<br>方法有很多种<br>1.Override wndproc<br>TMyEdit=class(TEdit)<br>protected:<br> procedure WndProc(var Message: TMessage); override;<br>........<br>procedure TMyedit.WndProc(var....)<br>begin<br> if Message.Msg=MyMessage then ...//自已的处理<br> inherited;<br>end;<br>end.<br>2.override defaulhandle,方法基本同上<br>3.定制消息map<br>TMyEdit=class(TEdit)<br>protected:<br> procedure MyMessageHandle(var Message: TMessage); Message MyMessage;<br>........<br>procedure TMyedit.MyMessageHandle(var Message: TMessage)<br>begin<br> ...//自已的处理<br>end;<br>....<br>end.<br>当然你要在const里定义MyMessage,当有人sendmessage给这个类的对象是就.....<br>