above
解决方案 »
- 关于OpenDialog的问题!!
- 如何双击外部程序中treeview的某个节点
- 请教一个关于create(nil)和create(self)还有create 之间的区别?
- 求助 应用程序如何立即感知系统输入法的改变,并记录下当前输入法
- 请FastReport高手来帮忙,看看怎样解决打印中文时,遇到换行有乱码的问题...等待中...
- 无聊5.1大派分 送出510分~ 之三
- 请教 键盘 激发窗体弹出的问题???
- 一个关于SQL 查询的问题
- (白了少年头)到底是用基于BDE的应用程序还是用ADO得好!
- 高手看这儿:怎样编程清理 IE的 History 目录(不用重启的那种)
- 谁知道图像剪影是怎么回事吗
- 谁有delphi6.0的中文帮助,谢谢
begin
application.HintColor:=clBtnFace;
end;祝:身体健康,答案和分数同样重要:)
begin
application.HintColor:=clred;
end;
begin application.HintColor:=clred;end;
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开发人员上抄的,在主单元中引用该单元就可以了