【问题标题】:How to change foreground color fo a textbox programmaticallly in Silverlight?如何在 Silverlight 中以编程方式将前景色更改为文本框?
【发布时间】:2014-05-18 11:06:11
【问题描述】:

我想在单击文本框时更改它的前景属性。在 WPF 中我可以说 textBox1.Foreground = Brushes.Black; 但在 Silverlight 中你不能使用 System.Drawing。有没有其他方法可以做到这一点?

【问题讨论】:

    标签: silverlight silverlight-5.0


    【解决方案1】:

    在 Silverlight 中,您可以将SolidColorBrush 实例用作Foreground,例如:

    textBox1.Foreground = new SolidColorBrush(Colors.Black);
    

    【讨论】:

    • 我一直在尝试使用颜色而不是颜色。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-08
    • 2013-08-28
    • 2023-03-19
    • 2019-03-04
    • 2015-04-24
    • 1970-01-01
    相关资源
    最近更新 更多