请单击以进行评分并提供反馈
MSDN
MSDN Library
.NET 开发
.NET Framework
RichTextBox 类
 IsDocumentEnabled 属性

  开启低带宽视图
.NET Framework 类库
RichTextBox..::.IsDocumentEnabled 属性

更新:2007 年 11 月

获取或设置一个值,该值指示用户是否可以与 RichTextBox 内的 UIElementContentElement 对象进行交互。

命名空间:  System.Windows.Controls
程序集:  PresentationFramework(在 PresentationFramework.dll 中)
用于 XAML 的 XMLNS:http://schemas.microsoft.com/winfx/xaml/presentation

Visual Basic(声明)
Public Property IsDocumentEnabled As Boolean
Visual Basic (用法)
Dim instance As RichTextBox
Dim value As Boolean

value = instance.IsDocumentEnabled

instance.IsDocumentEnabled = value
C#
public bool IsDocumentEnabled { get; set; }
Visual C++
public:
property bool IsDocumentEnabled {
    bool get ();
    void set (bool value);
}
J#
/** @property */
public boolean get_IsDocumentEnabled()
/** @property */
public  void set_IsDocumentEnabled(boolean value)
JScript
public function get IsDocumentEnabled () : boolean
public function set IsDocumentEnabled (value : boolean)
XAML 属性用法
<object IsDocumentEnabled="bool" .../>

属性值

类型:System..::.Boolean

如果用户可以与 RichTextBox 内的 UIElementContentElement 对象进行交互,则为 true;否则为 false

.NET Framework 3.5 版中引入了 IsDocumentEnabled。有关更多信息,请参见 .NET Framework 3.5 体系结构

下面的示例创建 CheckBox 和一个包含 HyperlinkButtonRichTextBoxRichTextBoxIsDocumentEnabled 属性绑定到 CheckBoxIsChecked 属性。 当用户选择 CheckBox 时,用户可以与 ButtonHyperlink 交互。当用户清除 CheckBox 时,将禁用 ButtonHyperlink

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

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

.NET Framework

受以下版本支持:3.5 SP1、3.0 SP1
社区内容   什么是社区内容?
添加新内容 RSS  批注
Processing
© 2009 Microsoft Corporation 版权所有。 保留所有权利  |  商标  |  隐私权声明
Page view tracker