当然能,不过你要在application的onshowhint事件中进行处理
解决方案 »
- 客户端Socket连接,老是要重启一下网卡,客户端Socket连接才能正常呢
- 怎样把图片Image存到剪切板
- Delphi如何编写SQLSERVER 扩展存储过程!??
- 如何隐藏应用程序在任务栏图标,在使用最小化按钮时,出现的动态效果是缩小到任务栏的托盘区域?
- 请问:怎样将一个form放到最前面而又不得到焦点?
- delphi编写QQ客户端 我现在应该怎么做
- 请问这两句代码是什么意思?
- 怎样设定Tbitmap的图像色深品质?
- 在DELPHI中,有一个OLE控件,如何改变它的底色?
- 如果能把专家分加入帖子加分该有多好啊!向斑竹建议!!!!!!!!!
- 在DELPHI调用FLASH文件,用了SHOCKWAVEFLASH也是不行?
- 我想做一个主页, 用到sql server数据库。 需要哪些软件及开发工具去实现。谢谢各位,参与有分
如果您喜欢请到www.netgocn.com
现修改为图片
unit unt1;interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, math,
ExtCtrls, StdCtrls, comCtrls;Type
TMyHintWindow = Class(THintWindow)
private
FRegion: THandle;
Fbmp: TBitmap;
Procedure FreeCurrentRegion;
public
constructor Create(AOwner: TComponent); override;
procedure ActivateHint(Rect: TRect; Const AHint: string); override;
procedure Paint; override;
end;implementation{ TMyHintWindow }procedure TMyHintWindow.ActivateHint(Rect: TRect; const AHint: string);
begin
With Rect do
begin
Right := Left + Fbmp.Width;
Bottom := Top + Fbmp.Height;
end;
BoundsRect := Rect;
FreeCurrentRegion;
with BoundsRect do
Fregion := CreateRectRgn(0, 0, Width, height);
if Fregion <> 0 then
SetWindowRgn(Handle, FRegion, True);
Inherited;
end;constructor TMyHintWindow.Create(AOwner: TComponent);
begin
inherited;
Fbmp.LoadFromFile(''); //代替的图片
end;procedure TMyHintWindow.FreeCurrentRegion;
begin
if Fregion <> 0 then
begin
SetWindowRgn(Handle, 0, True);
DeleteObject(Fregion);
Fregion := 0;
end;
end;procedure TMyHintWindow.Paint;
var
r: Trect;
pt: PaintStruct;
begin
r := Rect(Fbmp.Left, Fbmp.Top, Fbmp.Left + Fbmp.Width, Fbmp.Top + Fbmp.Height);
BeginPaint(handle, pt);
Canvas.CopyRect(FRegion, FBmp.Canvas, r);
EndPaint(Handle, pt);
end;initialization if Application <> nil then
begin
Application.ShowHint := False;
HintWindowClass := TMyHintWindow;
Application.ShowHint := True;
end;finalizationend.
unit unt1;interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, math,
ExtCtrls, StdCtrls, comCtrls;Type
TMyHintWindow = Class(THintWindow)
private
FRegion: THandle;
Fbmp: TBitmap;
Procedure FreeCurrentRegion;
public
constructor Create(AOwner: TComponent); override;
Destructor Destroy; override;
procedure ActivateHint(Rect: TRect; Const AHint: string); override;
procedure Paint; override;
end;implementation{ TMyHintWindow }procedure TMyHintWindow.ActivateHint(Rect: TRect; const AHint: string);
begin
With Rect do
begin
Right := Left + Fbmp.Width;
Bottom := Top + Fbmp.Height;
end;
BoundsRect := Rect;
FreeCurrentRegion;
with BoundsRect do
Fregion := CreateRectRgn(0, 0, Width, height);
if Fregion <> 0 then
SetWindowRgn(Handle, FRegion, True);
Inherited;
end;constructor TMyHintWindow.Create(AOwner: TComponent);
begin
inherited;
Fbmp := TBitmap.Create;
Fbmp.LoadFromFile(''); //代替的图片
end;destructor TMyHintWindow.Destroy;
begin
FBmp.Free;
inherited;
end;procedure TMyHintWindow.FreeCurrentRegion;
begin
if Fregion <> 0 then
begin
SetWindowRgn(Handle, 0, True);
DeleteObject(Fregion);
Fregion := 0;
end;
end;procedure TMyHintWindow.Paint;
var
r: Trect;
pt: PaintStruct;
begin
r := Rect(0, 0, Fbmp.Width, Fbmp.Height);
BeginPaint(handle, pt);
Canvas.CopyRect(Self.BoundsRect, FBmp.Canvas, r);
EndPaint(Handle, pt);
end;initialization if Application <> nil then
begin
Application.ShowHint := False;
HintWindowClass := TMyHintWindow;
Application.ShowHint := True;
end;finalizationend.
initialization ....
这段代码。