C# 使用ApplyPropertyValue为文本加下划线
我想使用ApplyPropertyValue中的textrange为所选文本加下划线。 以下是我的一行代码:C# 使用ApplyPropertyValue为文本加下划线,c#,.net,wpf,C#,.net,Wpf,我想使用ApplyPropertyValue中的textrange为所选文本加下划线。 以下是我的一行代码: new TextRange(start, end).ApplyPropertyValue(??, TextDecorations.Underline); 您需要在其中传递dependency属性,它是Inline.TextDecorationsProperty- new TextRange(start, end).ApplyPropertyValue(Inline.TextDecora
new TextRange(start, end).ApplyPropertyValue(??, TextDecorations.Underline);
您需要在其中传递dependency属性,它是
Inline.TextDecorationsProperty
-
new TextRange(start, end).ApplyPropertyValue(Inline.TextDecorationsProperty,
TextDecorations.Underline);
根据MSDN文件,该方法采用和
您可能正在查找Dependency属性
new TextRange(start, end).ApplyPropertyValue(
Inline.TextDecorationsProperty,
TextDecorations.Underline);
好的,那个代码有什么问题吗?我在属性值参数中使用了“?”,我应该用什么替换它?
new TextRange(start, end).ApplyPropertyValue(
Inline.TextDecorationsProperty,
TextDecorations.Underline);