1
표준 WPF RichTextBox
컨트롤을 사용하고 있습니다.'배경'속성이 텍스트 서식 지정에 유효하지 않습니다.
나는 성공적 전경 색상을 설정하지만, 배경 색상을 설정하면 다음과 오류 제공 할 수 있습니다 내가 사용하고
// SUCCESS
this.rtfDocument.Selection.ApplyPropertyValue(
System.Windows.Controls.RichTextBox.ForegroundProperty,
System.Windows.Media.Brushes.Red);
// ERROR
this.rtfDocument.Selection.ApplyPropertyValue(
System.Windows.Controls.RichTextBox.BackgroundProperty,
System.Windows.Media.Brushes.Blue);
: 여기
내가 함께 테스트있어 코드를System.ArgumentException: ''Background' property is not valid for text formatting.'
System.Windows.Media
네임 스페이스 브러쉬 다른 Stackoverflow 질문 언급.
편집 :
// SUCCESS
var f = this.rtfDocument.Selection.GetPropertyValue(
System.Windows.Controls.RichTextBox.ForegroundProperty);
// ERROR
var b = this.rtfDocument.Selection.GetPropertyValue(
System.Windows.Controls.RichTextBox.BackgroundProperty);
아마 오류가 실제 재산 어떻게 든 그 자체로 할 것입니다 :
은 흥미롭게도 배경색을 받고이 오류가 발생합니다?