Tbitbtn按钮,当鼠标移到上面时,按钮字体变色,移出时变回原来的颜色,请高手指点……,在线急等之!!!!

解决方案 »

  1.   

    继承一下
    增加
        property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
        property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
    处理CM_MOUSEENTER,CM_MOUSELEAVE
      

  2.   

    procedure TForm1.BitBtn1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
      if (X>0) and (X<BitBtn1.Width) and (Y>0) and (Y< Bitbtn1.Height ) then
        BitBtn1.Font.Color := clBlue
      else
        BitBtn1.Font.Color := clRed;
    end;procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
      if (X>BitBtn1.Left) and (X<BitBtn1.Left+BitBtn1.Width)
        and (Y>BitBtn1.Top) and (Y< BitBtn1.Top+Bitbtn1.Height ) then
        BitBtn1.Font.Color := clBlue
      else
        BitBtn1.Font.Color := clRed;
    end;
      

  3.   

    好 了,分分了!to lijinghe1(不要给我分):你的名字好怪呀,下次不给你分了!!!