RichTextBox.IsDocumentEnabled Propriété

Définition

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

Boolean

true si l'utilisateur peut interagir avec les objets UIElement et ContentElement dans la RichTextBox ; sinon, false.

Exemples

L’exemple suivant crée CheckBox et un RichTextBox qui contient un Hyperlink et un Button. La IsDocumentEnabled propriété de l’objet RichTextBox est liée à la IsChecked CheckBoxpropriété du . Lorsque l’utilisateur sélectionne le CheckBox, l’utilisateur peut interagir avec le Button et Hyperlink. Lorsque l’utilisateur efface le CheckBox, le 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

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

S’applique à