c#apply属性值关闭下划线(文本修饰)

时间:2014-05-09 16:09:41

标签: c# text-decorations

您好我想知道是否有办法使用applypropertyvalue转换下划线文本修饰属性,或者是否有更好的方法来执行此操作。

我有这个代码可以正常工作:

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

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

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

1 个答案:

答案 0 :(得分:1)

将第二个参数设置为null:

textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, null);