Окно подсказки приложения, подобное WinZip
Просто добавьте этоту модуль в менеджере проектов и Ваше приложение будет отображать подсказки подобно WinZip.
unit untHint;
interface
uses
Windows, Controls, Forms, Graphics;
type
TAppHintWindow = class ( THintWindow )
protected
procedure Paint; override;
function CalcHintRect (
MaxWidth: Integer; const AHint: string;
AData: Pointer ): TRect; override;
end;
implementation
function TAppHintWindow.CalcHintRect;
var
r: TRect;
begin
r := inherited CalcHintRect (
MaxWidth, AHint, AData);
inflateRect (r, 6, 3);
result := r;
end;
procedure TAppHintWindow.Paint;
var
R: TRect;
begin
with Canvas do begin
R := ClientRect;
Brush.Color := $00EAFFFF;
FillRect (r);
Font.Name := 'Tahoma';
Inc ( R.Left, 7 );
Inc ( R.Top, 5 );
DrawText (canvas.Handle, PChar (
Caption), -1, R, DT_LEFT or DT_NOPREFIX or
DT_WORDBREAK);
end;
end;
initialization
HintWindowClass := TAppHintWindow;
end.
Комментарии