delphiuser-interfacetooltipfiremonkey

Is there any way to add a hint or tooltip with FireMonkey?


It seems that FireMonkey does not have built in support for showing hints? At least I cannot find how to do that.

Is there any way to add a hint or tooltip to FireMonkey controls?

Ideally I am looking for something like this (a callout type tooltip):

a callout type tooltip


Solution

  • This is how I finally did it: to create a hint for a Button that looks like this:

    enter image description here

    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:

    enter image description here

    Then go to the TPopup and set PlacementTarget to Button1 (your button). Next, go to Placement and select BottomCenter:

    enter image description here

    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.