4

I just can't find a way of changing background color of Edit control in my mobile FireMonkey application.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Edijs Kolesnikovičs
  • 1,627
  • 3
  • 18
  • 34

1 Answers1

7

I dont know about FMX for mobile, but in FMX for Mac/Win you should do following steps:

  1. Right click on TEdit and select Edit Custom Style
  2. In Structure window, expand editstyle (TLayout)
  3. Put a TRectangle on content (TRectangle becomes child of content)
  4. Change Rectangle.HitTest to False
  5. Change Rectangle.Align to alClient
  6. Change Rectangle.Fill.Color to a custom color
  7. Change Rectangle.Stroke.Kind to bkNone
  8. Apply and Close

enter image description here enter image description here

mh taqia
  • 3,506
  • 1
  • 24
  • 35
  • 1
    I've removed my down vote and voted up, you were correct, this does seem to work. However the OP will get stuck at the first instruction due to there not being any Edit Custom Style popup menu choice in Firemonkey mobile(xe4). – Peter Aug 27 '13 at 07:37
  • Indeed, I have no 'Edit Custom Style' in XE4. – Edijs Kolesnikovičs Aug 27 '13 at 07:44
  • 1
    @EdijsKolesnikovičs Instead of "Edit Custom Style" you can achive same result if you add rectangle on Edit ApplyStyleLookup event in runtime. Check this similar [question:](http://stackoverflow.com/questions/17653139/delphi-xe4-firemonkey-tmemo-transparent-ios/17764884#17764884) – AvgustinTomsic Aug 28 '13 at 18:32