【发布时间】: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