locked
TextBox Caret Colour

    Question

  • I'm currently developing an application that has a large text entry form, the design for the form follows the Calendar app new appointment in that around 60% of the screen is for text entry.

    The major difference between that app and mine is that I'm using the Dark theme. In order to fit with the visual theme the text entry area has a dark background (in this case ApplicationPageBackgroundThemeBrush). However the Text Box caret / cursor is Black and is useless, I can change the Foreground for the text colour, but the caret doesn't change.

    As its stands I'm stuck between three bad choices, either use a light background but have that form look visually different from the rest of the app, restyle the entire app to a light theme, or have a TextBox with an invisible caret (and a poor UX).

    Is there any way to change the visuals of the caret (and if possible the selection colour) for a TextBox or does any one have any other good ideas?

    Thursday, July 26, 2012 10:58 PM

Answers

  • If you are using Xaml then neither the caret or selection color is overridable.

    Rather than retheming the entire app you could change the TextBox to a light background when it has the Focus and leave it dark when it is unfocused.

    --Rob

    Friday, July 27, 2012 12:04 AM
    Owner

All replies

  • If you are using Xaml then neither the caret or selection color is overridable.

    Rather than retheming the entire app you could change the TextBox to a light background when it has the Focus and leave it dark when it is unfocused.

    --Rob

    Friday, July 27, 2012 12:04 AM
    Owner
  • Thanks for that Rob, a bit disappointing but understandable for the first version.

    Regarding changing the colour, that works well for small text boxes, but for a UI similar to the "add new entry" in the Calendar app where 60% of the screen is changing the effect is too jarring.

    Cheers

    Friday, July 27, 2012 10:52 AM
  • Is this changing in the final release?  I have a similar issue.
    Wednesday, August 15, 2012 9:44 PM
  • Its very bad, after year of waiting, still no <TextBox CaretBrush="colorString"/> as in WPF and silverlight.
    Thursday, August 23, 2012 12:03 PM
  • If you are using Xaml then neither the caret or selection color is overridable.

    Rather than retheming the entire app you could change the TextBox to a light background when it has the Focus and leave it dark when it is unfocused.

    --Rob

    That's really strange. Shouldn't the caret have the same color as the foreground?

    What is a code digger? Find out here: http://www.urbandictionary.com/define.php?term=Code+digger

    Monday, December 17, 2012 7:10 PM