【问题标题】:c# apply property value turn off underline (text decoration)c#应用属性值关闭下划线(文字装饰)
【发布时间】:2014-05-09 16:09:40
【问题描述】:

您好,我想知道是否有办法使用 applypropertyvalue 转换下划线文本装饰属性,或者是否有更好的方法。

我的代码可以正常工作:

textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, TextDecorations.Underline);

但是当我想关闭它时没有 textdecoration.none

textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, TextDecorations.None);

【问题讨论】:

  • 你试过为第二个参数传递一个空值吗?
  • 我试过 TextDecorations.None & TextDecorations.Null
  • null 怎么样?
  • 还有其他方法可以传递空值,我不确定如何在 ApplyPropertyValue 函数中进行
  • 效果很好,只是 null 非常感谢,您可以将其作为答案发布,我将标记为正确,所以我所做的是 textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, null);

标签: c# text-decorations


【解决方案1】:

设置第二个参数为null:

textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, null);

【讨论】:

    猜你喜欢
    • 2011-10-23
    • 2014-03-13
    • 1970-01-01
    • 2018-12-22
    • 1970-01-01
    • 1970-01-01
    • 2012-03-24
    • 2013-09-26
    • 1970-01-01
    相关资源
    最近更新 更多