如何 实现 动态 显示 HINT ???????????????????????????急!!!!!已经 为 button1 控件的 HINT 属性设置了 ‘test’ 的提示字符 , showHint 属性 设为 false (因为需要动态显示出来,而不是鼠标停留才显示出来) 例如 : 点击button2 控件, 就把 button1 的 HINT 显示在 button1 上请问如何实现
调试欢乐多
var
hwHint : THintWindow;
begin
hwHint := THintWindow.Create(self); //显示Hint
hwHint.ActivateHint(Rect(位置Left, 位置Top, 宽,高), '文字内容');
Sleep(2000);
//删除Hint
hwHint.ReleaseHandle;
//释放对象
hwHint.Free;
end;这是一个例子,楼主可以把显示,和删除放到不同的事件里,就行了,不过这个东西必须要手工删除Hint,不能自动。
我试过你的代码,但什么都看不见
var
hwHint : THintWindow;
begin
hwHint := THintWindow.Create(self); //显示Hint
hwHint.ActivateHint(Rect(200,200,150,150), 'test');end;
var
h : THintWindow;
r : TRect;
begin
with r do
begin
left := 10;
top := 20;
right := 200;
bottom := 100;
end;
h := THintWindow.Create( Self );
with h do
begin
Color := clInfoBk;
ActivateHint( r, 'hi there!' );
MessageBox( 0, 'Press any key to close the '
+ 'hint window', 'THintWindow', MB_OK );
ReleaseHandle;
Free;
end;
end;