1

创建一个 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 作为默认值?

4

0 回答 0