Reputation: 2005
I want to allow the entry of different coloured alpha numeric into a text box. The person clicks on one of four buttons (blue, grey, green or red) to select the colour and that colour applies to all alpha numeric entered into the text box until a new colour is selected (e.g., KPB - the K is blue and the PB is red; -6 is green).
Thanks,
Glyn
Hi @AndreiVolgin,
This is how I implemented your suggestion. I am working on getting the display a bit "nicer".
Thanks,
Glyn
Upvotes: 0
Views: 47
Reputation: 41100
You cannot style text inside a TextBox - even "::first-letter" selector does not work on it.
You can try to create your own widget which will include a transparent TextBox widget on top of a Label widget, where on each KeyUpEvent in the TextBox you update the Label widget with the corresponding text in different colors.
Upvotes: 1