1

Create a VCL Forms Application, put a TBalloonHint and a TButton on the form and in the button's click-event handler write this code:

procedure TForm2.btnTestClick(Sender: TObject);
begin
  if balloonhintTest.ShowingHint then
    ShowMessage('balloonhintTest is showing')
  else
    ShowMessage('balloonhintTest is not showing');
end;

Strangely, when clicking the button at runtime, this message is displayed:

enter image description here

...although it has never programmatically been shown with balloonhintTest.ShowHint.

The only way I found so far to prevent this is the following workaround:

procedure TForm2.FormCreate(Sender: TObject);
begin
  balloonhintTest.HideHint;
end;

So why the BalloonHint is reported as showing (while it is not physically showing at all) as default, and is there a better way to set this to False as default?

user1580348
  • 5,721
  • 4
  • 43
  • 105
  • In the `TCustomHint` constructor, `FShow` is set to `True`: `FShow := True;`. Why? `TBalloonHint` is an object which is created together with the main form, not when it is shown. – user1580348 Jan 13 '17 at 14:13
  • The only other way I've found is using an "interposer" class: http://i.imgur.com/el7l9Zm.png Is this correct? – user1580348 Jan 13 '17 at 15:20
  • 1
    Sounds like a bug, did you [report it to Embarcadero](http://quality.embarcadero.com) yet? – Remy Lebeau Jan 13 '17 at 20:37

0 Answers0