RichTextBox.IsDocumentEnabled 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示用户是否可以与UIElementContentElement内RichTextBox的对象进行交互。
public:
property bool IsDocumentEnabled { bool get(); void set(bool value); };
public bool IsDocumentEnabled { get; set; }
member this.IsDocumentEnabled : bool with get, set
Public Property IsDocumentEnabled As Boolean
属性值
示例
以下示例创建CheckBox并包含 a Hyperlink 和 a ButtonRichTextBox . 该 IsDocumentEnabled 属性 RichTextBox 绑定到 IsChecked 该属性的属性 CheckBox。 当用户选择CheckBox时,用户可以与 and Hyperlink交互Button。 当用户清除时 CheckBox,将 Button 禁用和 Hyperlink 禁用。
<StackPanel>
<CheckBox Name="IsDocumentEnabledChbk" Content="IsDocumentEnabled"/>
<RichTextBox Name="richTB"
IsDocumentEnabled="{Binding ElementName=IsDocumentEnabledChbk,
Path=IsChecked}">
<FlowDocument>
<Paragraph>
Use the Checkbox above to switch between enabling and
disabling the Button and Hyperlink in the RichTextBox.
<Hyperlink>Here is a hyperlink</Hyperlink>
</Paragraph>
<BlockUIContainer>
<Button>Click me!</Button>
</BlockUIContainer>
</FlowDocument>
</RichTextBox>
</StackPanel>
注解
IsDocumentEnabled 在 .NET Framework 版本 3.5 中引入。 有关详细信息,请参阅 版本和依赖项。