2

Is there a way to change the colour of a wxTextCtrl when it is disabled or another way to lock the control for input when it is enabled?

I don't like the gray text on a gray background, with a gray border, it makes the information inside the control harder to read.

I'm using wxSmith, there is no tag available for it.

hennep
  • 545
  • 4
  • 12

2 Answers2

2

Call SetEditable(false) for the text control to block input.

catalin
  • 1,927
  • 20
  • 20
  • Excellent solution, I'm unable to change the values and I can still select and copy the values. THANK YOU!! – hennep Jul 02 '19 at 14:39
1

You can also give the wxtextCtrl the style wxTE_READONLY at creation time to do the same thing.

Regards Xav'

Xaviou
  • 166
  • 3
  • Both options work fine but this one is less work, that's important for a lazy person like me :-) – hennep Jul 03 '19 at 15:21