简体   繁体   English

如何将文本框的边框颜色重置为默认系统颜色

[英]How to reset the Border color of a text box to the default system color

I'm changing the color of a textbox to red for validation in WPF 我正在将文本框的颜色更改为红色以在WPF中进行验证

I can't find a way to change it back to the system default upon clearing my form. 清除表单后,我无法找到将其更改回系统默认值的方法。

I thought there was an easy way to change it back to the default by clearing the border brush proper but I can't seem to find it. 我以为有一种简单的方法,可以通过清除适当的边框笔刷将其更改回默认值,但我似乎找不到。

Is there an easy way to reset it to the default with out having to set it manually to the system color? 是否有一种简便的方法可以将其重置为默认值,而无需手动将其设置为系统颜色?

了解如何做:

Textbox.ClearValue(Border.BorderBrushProperty)
TextBox.BorderColor = Color.Empty

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM