Partager via


RichTextBox.IsDocumentEnabled Propriété

Définition

Obtient ou définit une valeur qui indique si l’utilisateur peut interagir avec et ContentElement des UIElement objets dans le 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

Valeur de propriété

truesi l’utilisateur peut interagir avec et objets UIElement dans le RichTextBox; sinon, false.ContentElement

Exemples

L’exemple suivant crée CheckBox et un RichTextBox qui contient un Hyperlink et un Button. La IsDocumentEnabled propriété du fichier RichTextBox est liée à la IsChecked propriété du CheckBox. Lorsque l’utilisateur sélectionne le CheckBox, l’utilisateur peut interagir avec le Button et Hyperlink. Lorsque l’utilisateur efface , CheckBoxle Button et Hyperlink est désactivé.

<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>

Remarques

IsDocumentEnabled est introduit dans .NET Framework version 3.5. Pour plus d’informations, consultez Versions et dépendances.

S’applique à