我有一个WPF窗口,其中我有一个FlowDocumentScrollViewer,一个FlowDocument作为它的孩子。当然,在FlowDocument元素中,我有网格、文本框等,它们都工作得很好,但每当我单击它们时,滚动条就会一直向下滚动。代码如下:
<FlowDocumentScrollViewer Grid.Row="1" Grid.Column="1">
<FlowDocument x:Name="flowDoc" PagePadding="0">
<Section>
<BlockUIContainer>
<Border BorderBrush="Red" BorderThickness="2">
<Grid x:Name="masterGrid" Height="1500">
<!--window structure here-->
</Grid>
</Border>
</BlockUIContainer>
</Section>
</FlowDocument>
</FlowDocumentScrollViewer>这不是我们想要的行为,但我也不知道是什么原因造成的。我如何防止它的发生?
发布于 2020-10-29 19:01:41
好吧,不是说原因(还不清楚),而是问题本身,我设法让它停止向下滚动,删除了FlowDocument和Section,并将FlowDocumentScrollViewer切换为ScrollViewer。对于我的需求,这是可能的,也是足够的。
https://stackoverflow.com/questions/64553116
复制相似问题