N
noall
Unregistered / Unconfirmed
GUEST, unregistred user!
从component-》new component 选择Tlabel后如何实现鼠标的移入与移出事件呢?
现有这样的:
procedure TURLLabel.WndProc(var Message: TMessage);
begin
if (Message.Msg = CM_MOUSELEAVE) then
begin
Font.Color := clWindowText;
Font.Style := Font.Style - [fsUnderline];
end;
if (Message.Msg = CM_MOUSEENTER) then
begin
Font.Color := clBlue;
Font.Style := Font.Style + [fsUnderline];
end;
inherited WndProc(Message);
end;
我想把它当作事件,应该怎么实现。
现有这样的:
procedure TURLLabel.WndProc(var Message: TMessage);
begin
if (Message.Msg = CM_MOUSELEAVE) then
begin
Font.Color := clWindowText;
Font.Style := Font.Style - [fsUnderline];
end;
if (Message.Msg = CM_MOUSEENTER) then
begin
Font.Color := clBlue;
Font.Style := Font.Style + [fsUnderline];
end;
inherited WndProc(Message);
end;
我想把它当作事件,应该怎么实现。