1

Like in the title.

I cleared all styles and still - when the user select text in entry or editor there is coloured background of this selected text. I want to set what colour it would be. How to do that?

Right now this is the Windows theme colour but it made the application ugly, as this colour is irrelevant to my layout. How to set this colour for my own or disable this Windows theme styling at all.

jaydopartu
  • 63
  • 1
  • 8
  • Try using [Visual states](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/visual-states). However, I don't know if that works when only some of the text is selected - I've only used when an entire element (e.g. a label) is picked. – ToolmakerSteve Oct 18 '22 at 19:35
  • Thank you for the hint. I tried but there is no property that I can use, and this is not depending on the VisualState or not. There is no property like SelectedColor or so in the API of Entry control. – jaydopartu Oct 18 '22 at 22:42
  • I managed to remove the underscore of the focused entry (also coloured by Windows colour) by addition of 0 0 into in Platforms/Windows/App.xaml but can't sucess with this question aim blue doesn't work – jaydopartu Oct 18 '22 at 22:43
  • 1
    I think you will have to make a [custom handler](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/handlers/customize), and change it in Windows-specific code. – ToolmakerSteve Oct 18 '22 at 23:14
  • Thank you for a hint. It looks like this is the way to go. I would give it a try. – jaydopartu Oct 19 '22 at 00:05
  • You can check this [link](https://stackoverflow.com/questions/46301150/change-focus-color-of-entry-control-in-xamarin-forms). – Jianwei Sun - MSFT Oct 21 '22 at 09:33

0 Answers0