InlineUIContainer & 中的控件在 RichTextBox.Document 中始终禁用 BlockUIContainer [英] Controls in InlineUIContainer & BlockUIContainer always disabled in RichTextBox.Document
问题描述
例如,如果我有如下代码,两个按钮都被禁用:
For example if i have code like the following both Buttons are disabled:
<RichTextBox>
<FlowDocument>
<BlockUIContainer>
<Button Content="!"/>
</BlockUIContainer>
<Paragraph>
<InlineUIContainer>
<Button Content="!"/>
</InlineUIContainer>
</Paragraph>
</FlowDocument>
</RichTextBox>
我不知道为什么会这样,或者我可以做些什么来防止这种情况发生,显然禁用的按钮不是很有用,因此我们将不胜感激.
I have no idea why this is the case or what i can do to prevent this, obviously disabled buttons are not very useful so any help to resolve this would be appreciated.
事实证明 FlowDocument 由于某种原因被禁用,但是我还没有找到重新启用它的方法,因为它变回 IsEnabled="False"
立即...
It turns out that the FlowDocument gets disabled for some reason, however i have not found a way to reenable it yet, since it changes back to IsEnabled="False"
immediately...
推荐答案
实际上有一个名为 IsDocumentEnabled
(.NET 3.5 以上)在 RichTextBox
本身上,可以设置为 true 以启用文档.
There actually is a property called IsDocumentEnabled
(.NET 3.5 onwards) on the RichTextBox
itself that can be set to true to enable the document.
这篇关于InlineUIContainer & 中的控件在 RichTextBox.Document 中始终禁用 BlockUIContainer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!