创建任意形状的Hint

stiwin 2002-08-21 05:42:59
unit Unit1;

interface

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

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

type
TMyHintWindow=class(THintWindow)
protected
procedure Paint;override;
end;

var
Form1: TForm1;

implementation

{$R *.dfm}


{ TMyHintWindow }

procedure TMyHintWindow.Paint;
var
NewShape: HRGN;
begin
NewShape := CreateEllipticRgn(0,2,Width+1,Height);//建立一个椭圆的Hint
SetWindowRgn(Handle, NewShape, TRUE);
Application.HintColor :=$005695AF;

inherited;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
HintWindowClass:=TMyHintWindow;
end;

end.
...全文
16 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
角落的青苔 2002-08-21
  • 打赏
  • 举报
回复
mark一下^_*
manboo 2002-08-21
  • 打赏
  • 举报
回复
关键的部分没有写噢!呵呵!~要动态匹配字体大小和内容的!

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧