I've earched for it but couldn't find anything. Is there any way to add a hint or tooltip with FireMonkey? Are there any components available that enable this?
Ideally I am looking for something like this (a callout type tooltip):
To the moderators who have placed this question on hold: I am looking for lines of source code on how to achieve this, not a software to buy/use. There are currently (AFAIK) no source code components that enable doing this, so there is no risk of "opinionated anwers or spam".
This is how I finally did it: to create a hint for a Button that looks like this:
Add a button to a form. Then add a TPopup. Drop a CalloutPanel inside it and optionally set the align to AlClient. The drop a TLabel on that CalloutPanel and write your hint text.
Your structure should look like this:
Then go to the TPopup and set PlacementTarget to Button1 (your button). Next, go to Placement and select BottomCenter:
Next add a handler for the MouseEnter and MouseLeave events on the button:
procedure TForm1.Button1MouseEnter(Sender: TObject);
begin
Popup1.IsOpen := True;
end;
procedure TForm1.Button1MouseLeave(Sender: TObject);
begin
Popup1.IsOpen := False;
end;
That should do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With