Board index » delphi » Hints & Font colors

Hints & Font colors

Hey,

We're using W95 and Delphi 3.0 for develop applications.
In W95 the color of hints is foregrond gray or white and background is
black. So the hints you're using in Delphi became the same color.
Is there a possibility to change the colors for the hints and the FONT
colors from hints so you can create other colors which are default
within W95.

Greetings Peter

 

Re:Hints & Font colors


Quote
In article <348EEC4D.6...@worldaccess.nl>, Peter van Mierlo wrote:
> In W95 the color of hints is foregrond gray or white
> and background is black.

You only see those colors because you've chosen them in the Windows '95
Control Panel (Display | Appearance | Tooltips). My tooltips (or hints)
are black on yellow.

Quote
> Is there a possibility to change the colors for the hints

Use the Application.HintColor property.

Quote
> FONT

This requires some more work. The following unit demonstrates the
technique:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
  StdCtrls;

type

  TFroggerHintWindow = class(THintWindow)
  protected
    procedure Paint; override;
  end;

  TForm1 = class(TForm)
    Edit1: TEdit;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TFroggerHintWindow.Paint;
var
  R: TRect;
begin
  R := ClientRect;
  Inc(R.Left, 2);
  Inc(R.Top, 2);
  Canvas.Font.Color := clYellow;
  DrawText(Canvas.Handle, PChar(Caption), -1, R,
    DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  HintWindowClass := TFroggerHintWindow;
  Application.HintColor := clGreen;
end;

end.

--
Rick Rogers (TeamB) | Fenestra Technologies

Other Threads