above

解决方案 »

  1.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    application.HintColor:=clBtnFace;
    end;祝:身体健康,答案和分数同样重要:)
      

  2.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      application.HintColor:=clred;
    end;
      

  3.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin  application.HintColor:=clred;end;
      

  4.   

    To: siyu2002(bayer), ghyghost(我要求delphi能理解我的心情) :不行啊, 不能改变在DBGrid中的Hint提示的背景颜色!
      

  5.   

    unit RndHint;interfaceuses
      Windows, Messages, Classes, Graphics, Controls, Forms;type
      TxgyHintWindow = class(THintWindow)
      private
        { Private declarations }
        FRegion:THandle;
        procedure FreeCurrentRegion;
      //protected
      public
        { Protected declarations }
        destructor Destroy;override;
        procedure  Activatehint(Rect:TRect;const AHint:String);override;
        procedure  Paint;override;
        procedure  CreateParams(var Params:TCreateParams);override;
      public
        { Public declarations }
      published
        { Published declarations }
      end;procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('XGY', [TxgyHintWindow]);
    end;{ TxgyHintWindow }procedure TxgyHintWindow.Activatehint(Rect: TRect; const AHint: String);
    begin
      with Rect do
        Right:= Right + Canvas.TextWidth('WWW');
      BoundsRect := Rect;
      FreeCurrentRegion;
      with BoundsRect do  //
       // FRegion := CreateRectRgnIndirect(BoundsRect);
        FRegion := CreateRoundRectRgn(0,0,Width,Height,Width,Height);
      if FRegion <> 0 then
        SetWindowRgn(Handle,FRegion,True);
      inherited;
    end;procedure TxgyHintWindow.CreateParams(var Params: TCreateParams);
    begin
      inherited;
      Params.Style := Params.Style and not ws_Border;
    end;destructor TxgyHintWindow.Destroy;
    begin
      FreeCurrentRegion;
      inherited;
    end;procedure TxgyHintWindow.FreeCurrentRegion;
    begin
      if FRegion<>0 then
      begin
        SetWindowRgn(Handle,0,true);
        DeleteObject(FRegion);
        FRegion := 0;
      end;
    end;procedure TxgyHintWindow.Paint;
    var
      R:TRect;
    begin
      R := ClientRect;
      Inc(R.Left,1);
      Canvas.Font.Color := clRed;
      DrawText(Canvas.Handle,PChar(Caption),Length(Caption),R,DT_NOPREFIX or
        DT_WORDBREAK or DT_CENTER or DT_VCENTER);  //inherited;
    end;initialization
      Application.ShowHint := false;
      HintWindowClass := TxgyHintWindow;
      Application.ShowHint := true;end.
    //
    在delphi5开发人员上抄的,在主单元中引用该单元就可以了