创建一个 VCL 表单应用程序,将 aTBalloonHint
和 aTButton
放在表单上,然后在按钮的单击事件处理程序中编写以下代码:
procedure TForm2.btnTestClick(Sender: TObject);
begin
if balloonhintTest.ShowingHint then
ShowMessage('balloonhintTest is showing')
else
ShowMessage('balloonhintTest is not showing');
end;
奇怪的是,在运行时单击按钮时,会显示此消息:
...尽管它从未以编程方式显示为balloonhintTest.ShowHint
.
到目前为止,我发现防止这种情况的唯一方法是以下解决方法:
procedure TForm2.FormCreate(Sender: TObject);
begin
balloonhintTest.HideHint;
end;
那么为什么 BalloonHint 被报告为默认显示(虽然它根本没有实际显示),并且有没有更好的方法将其设置为 False 作为默认值?