Setting The Mouse Cursor In Delphi XE5 And XE6 Firemonkey On Windows And OSX

Delphi XE5 Firemonkey Mouse CursorsAlister Christie from has a video up where he demonstrates changing the mouse cursor to the hourglass (or spinner) in Delphi XE5 Firemonkey. is a great resource of over 100 different videos (both free and paid) demonstrating how do to various things in Delphi. Obviously since most mobile devices don’t have cursors this example applies to Windows and OSX. This code should work in AppMethod and Delphi XE6 as well. This is his most recent video about Delphi Firemonkey. In the video he demonstrates how to acquire the IFMXCursorService interface from the TPlatformServices object which is contained in the FMX.Platform class. If you’ve ever done this in the Delphi VCL side of things the code will look familiar in that you set the cursor to crHourGlass and restore it back to it’s original state afterward. Sleep() is used in the example where you would have your real code that did work instead so that you can see the hourglass cursor in action. Finally farther into the he moved the code out into it’s own class called SmartCursor. Here is a sample of the code from the video:

Head over and watch the full video about setting the mouse cursor in Delphi Firemonkey.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

5 Responses to Setting The Mouse Cursor In Delphi XE5 And XE6 Firemonkey On Windows And OSX

  1. Flash Thunder says:

    There is no FMX.Platforms in Delphi XE6.

    • Admin says:

      FMX.Platform? Without the s?

      • Flash Thunder says:

        Oh yes, but there is mistake in article.

        • Brave says:

          hello sur :
          is there a Methode in how load a Custom cursor from file under firemonkey desktop application ?
          i tried that but without any succes ….
          usualy we use this under VCL :
          Procedure ….();
          Mycursor : integer = 5;
          cursor := MyCursor;
          finally With Best Regards : Brave

  2. brave says:

    hello sur :
    can explain to me the methode in how to load from file an external cursor under firemonkey desktop application usually under vcl we use this two lines of code :
    procedure …..();
    MyCursor : Integer = 5;
    screen.cursors[MyCursor] = LoadCursorFromFile(‘Data/Cursors/Cursor1.Ani’);
    cursor := MyCursor;

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Increase Productivity With Delphi Dev Shell Tools Utility For Delphi XE5, XE6, And AppMethod

The Delphi Dev Shell Tools utility for Windows has recently been updated to support XE6 and AppMethod. What this utility...