Reputation: 1415
Before I file a QC report to Embacadero, I wanted to know if there is something simple I am overlooking in regards to TEdit's and setting the 'TextPrompt' property.
Whenever trying to set TextPrompt of any TEdit, the Prompt does not show. Am I missing a step or is there a simple work around to this bug that anyone knows of currently?
Delphi XE7 for iOS ( FMX )
Upvotes: 4
Views: 3028
Reputation: 21
You need to use the stylebook to get this to work correctly.
Sample :
I'll stop here for a second. One would think that because TEdit contains a property called "Text Prompt" that this would be a no brainer, but adding text to this property does not work, why.... No idea. Anyhow.....
This will bring up the stylebook1 container.
That's it, you will see the text prompt in the tedit control, and when run on multi-platforms it works as expected.
Upvotes: 1
Reputation: 1276
You can also just stick a TLabel inside of your TEdit and align it to Content or Client. Set it's HitTest property to false. In the onChange event show it or hide it based on if the Text property is blank. TextPrompt had issues in previous versions too so I used this workaround instead.
Upvotes: 8