【问题标题】:Why can't I clear the background property (wpf control)为什么我不能清除背景属性(wpf控件)
【发布时间】:2015-11-20 11:02:44
【问题描述】:

为什么要用下面的方法清除背景

txb.Background.ClearValue(Control.BackgroundProperty);

给出一个例外

"无法清除对象 '#FFFFFFFF' 的背景属性,因为它 处于只读状态”

?

【问题讨论】:

    标签: c# wpf properties


    【解决方案1】:

    .Background 不是必需的。应该是:

    txb.ClearProperty(Control.BackgroundProperty);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-13
      相关资源
      最近更新 更多