From Xojo Documentation
Gets or sets a flag that indicates whether the window has been modified. The ContentsChanged event fires when the value of this property has changed. On macOS, the window's Close button displays a dot when ContentsChanged is True.
This example is in the ContentsChanged event of the control.