This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi,
I would like to changed the color of a textbox's cursor in the property grid. Our textbox's style is based of mindscape's generic.xaml, but somehow we've ended up with a white cursor on a light grey background which is very hard to see. Could you please let me know which brush affects the textbox's cursor color?
Thank you
|
|
|
I believe WPF works out the caret colour based on the background colour, and I'm not aware of a way to override this. I have heard tell that you can override the "non-overrideable" brushes of a text box (like the highlight) by defining resources with the appropriate resource keys from SystemColors, but I've never had this work consistently, and I don't see a resource key for the caret anyway. However, when I try giving a TextBox a light grey background, WPF guesses a black or near-black cursor rather than a white one. So I don't think you should need to override the caret colour anyway. The only way I could reproduce your problem was to make the background light grey using transparency rather than colouring: <!-- Results in white on "grey" - hard to read --> <!-- Results in black on grey - easy to read --> Evidently WPF doesn't consider composition when figuring out the caret colour. Is it possible you're taking the first approach? If not, can you provide a repro? |
|