KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility method that changes the mouse cursor based on the enabled state of an object
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: April 2, 2024

The provided utility method is designed to dynamically modify the mouse cursor behavior to augment the enable status of an object whenever the mouse hovers over it. This feature aims to offer users a more intuitive and visually informative interaction experience.

// Method: setCursorOnHover
Case of
  : (Form event code=On Mouse Enter)
    If (OBJECT Get enabled(*; OBJECT Get name(Object current))=False)
      SET CURSOR(9019)
    End if
  : (Form event code=On Mouse Leave)
    SET CURSOR
End case


To utilize this utility method, place a call to this method in any interactive object method that has the On Mouse Enter and On Mouse Leave events enabled.