搜索以下,很多的:
拦截CM_MOUSEENTER,CM_MOUSELEAVE事件。

解决方案 »

  1.   

    label好像有其它的事件啊:enter,exit
      

  2.   

    label好像有其它的事件啊:enter,exit
      

  3.   

    错了:((是mouseenter and mouseleave
      

  4.   

    写一个控件,给label加入onmouseenter和onmouseleave属性就行了
      

  5.   

    继续自TLabel做一个新控年
    TLabelEx = class(TLabel)
    private
      FOnMouseEnter: TNotifyEvent;
      FOnMouseLeave: TNotifyEvent;
    protected;
      procedure CMMouseEnter(var Message: TMessage); message CM_MouseEnter;
      procedure CMMouseLeave(var Message: TMessage); message CM_MouseLeave;
    public
      constructor Create(AOwner: TComponent); override;
    end;......
    .....
    ,....
    ,....
    ....procedure CMMouseEnter(var Message: TMessage);
    begin
      if Assigned(FOnMouseEnter) then
        FOnMouseEnter(self);
    end;procedure CMMouseLeave(var Message: TMessage);
    begin
      if Assigned(FOnMouseLeave) then
        FOnMouseLeave(self);
    end;
      

  6.   

    用MOUSEENER 和MOUSELEAVE!!!!嘿嘿!没有用mousemove
      

  7.   

      到我主页http://tzdgg.freephp.digiro.net/MyCo.zip下载组件包Myco.zip,里面有THyperlinkLabel组件就是这样做的,有源代码。
      

  8.   

    下面的做法简单些:
      TURLLabel = class(TLabel)
         Procedure WndProc(var message: TMessage); override;
      end ;................procedure TURLLabel.WndProc(var message: TMessage);
    begin //窗口过程
      if (Message.Msg=CM_MOUSELEAVE) then
      begin
         Font.Color := ClRed ;
         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;
      

  9.   

    嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻
    嘻嘻嘻伴水逍遥剑嘻嘻嘻嘻
    嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻procedure TForm1.FormCreate(Sender: TObject);
    begin
      with TButton.Create(Self) do begin
        Parent := Self;
        TabStop := False;
        Top := -100;
        Action := TAction.Create(Self);
        Action.OnUpdate := ActionUpdate;
      end;
    end;procedure TForm1.ActionUpdate(Sender: TObject);
    var
      vHandle: THandle;
      I, J: Integer;
    begin
      vHandle := WindowFromPoint(Mouse.CursorPos);
      for I := 0 to ComponentCount - 1 do
        if (Components[I] is TWinControl) and
          (TWinControl(Components[I]).Handle = vHandle) then
          with TWinControl(Components[I]) do
            for J := 0 to ControlCount - 1 do
              if Controls[J] is TLabel then
                if PtInRect(TLabel(Controls[J]).BoundsRect,
                  ScreenToClient(Mouse.CursorPos)) then
                  TLabel(Controls[J]).Font.Color := clRed
                else TLabel(Controls[J]).Font.Color := clWindowText;
      for J := 0 to ControlCount - 1 do
        if Controls[J] is TLabel then
          if PtInRect(TLabel(Controls[J]).BoundsRect,
            ScreenToClient(Mouse.CursorPos)) then
            TLabel(Controls[J]).Font.Color := clRed
          else TLabel(Controls[J]).Font.Color := clWindowText;
    end;