RichTextBox.IsDocumentEnabled 屬性

定義

取得或設定值,這個值表示使用者是否可以與 UIElement 中的 ContentElementRichTextBox 物件互動。

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

屬性值

Boolean

如果使用者可以與 UIElement 中的 ContentElementRichTextBox 物件互動,則為 true,否則為 false

範例

下列範例會 CheckBox 建立 和 RichTextBox ,其中包含 HyperlinkButtonIsDocumentEnabledRichTextBox 屬性系結至 IsCheckedCheckBox 屬性。 當使用者選取 CheckBox 時,使用者可以與 ButtonHyperlink 互動。 當使用者清除 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 版引進。 如需詳細資訊,請參閱版本和相依性

適用於