更新:2007 年 11 月
命名空间:
System.Windows.Controls 程序集:
PresentationFramework(在 PresentationFramework.dll 中)
用于 XAML 的 XMLNS:http://schemas.microsoft.com/winfx/xaml/presentation
Public Property IsDocumentEnabled As Boolean
Dim instance As RichTextBox
Dim value As Boolean
value = instance.IsDocumentEnabled
instance.IsDocumentEnabled = value
public bool IsDocumentEnabled { get; set; }
public:
property bool IsDocumentEnabled {
bool get ();
void set (bool value);
}
/** @property */
public boolean get_IsDocumentEnabled()
/** @property */
public void set_IsDocumentEnabled(boolean value)
public function get IsDocumentEnabled () : boolean
public function set IsDocumentEnabled (value : boolean)
<object IsDocumentEnabled="bool" .../>
.NET Framework 3.5 版中引入了 IsDocumentEnabled。有关更多信息,请参见 .NET Framework 3.5 体系结构。
下面的示例创建 CheckBox 和一个包含 Hyperlink 和 Button 的 RichTextBox。 RichTextBox 的 IsDocumentEnabled 属性绑定到 CheckBox 的 IsChecked 属性。 当用户选择 CheckBox 时,用户可以与 Button 和 Hyperlink 交互。当用户清除 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>
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
.NET Framework
受以下版本支持:3.5 SP1、3.0 SP1
参考