B
balaschen
Unregistered / Unconfirmed
GUEST, unregistred user!
请看如下代码:
procedure TForm2.WMNCHitTest(var M: TWMNCHitTest);
begin
Inherited;//下面的语句起作用
if (M.Result=HTClient) then
begin
M.Result:=HTCaption;
end;
//Inherited,如Inherited写在这,则上面的语句不起作用。
end;
而
procedure TForm2.WMLButtonDown(var M: TWMLButtonDown);
begin
SendMessage(Handle,WM_NCLBUTTONDown,HTCaption,GetMessagePos);
//不管写不写Inerited,或写前写后,上面的语句均起作用。
end;
究竟Inherited写先写和后写有什么区别?
procedure TForm2.WMNCHitTest(var M: TWMNCHitTest);
begin
Inherited;//下面的语句起作用
if (M.Result=HTClient) then
begin
M.Result:=HTCaption;
end;
//Inherited,如Inherited写在这,则上面的语句不起作用。
end;
而
procedure TForm2.WMLButtonDown(var M: TWMLButtonDown);
begin
SendMessage(Handle,WM_NCLBUTTONDown,HTCaption,GetMessagePos);
//不管写不写Inerited,或写前写后,上面的语句均起作用。
end;
究竟Inherited写先写和后写有什么区别?