RichTextBox.IsDocumentEnabled Proprietà

Definizione

Ottiene o imposta un valore che indica se l’utente può interagire con gli oggetti UIElement e ContentElement contenuti in un oggetto 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

Valore della proprietà

Boolean

true se l’utente può interagire con gli oggetti UIElement e ContentElement contenuti in RichTextBox; altrimenti, false.

Esempio

Nell'esempio seguente viene creato e viene RichTextBox creato CheckBox un oggetto che contiene un Hyperlink oggetto e un Buttonoggetto . La IsDocumentEnabled proprietà dell'oggetto RichTextBox CheckBoxè associata alla IsChecked proprietà di . Quando l'utente seleziona CheckBox, l'utente può interagire con Button e Hyperlink. Quando l'utente cancella , CheckBoxe Button Hyperlink viene disabilitato.

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

Commenti

IsDocumentEnabledviene introdotto nella .NET Framework versione 3.5. Per altre informazioni, vedere Versioni e dipendenze.

Si applica a