XAML 禁用FlowDocument中的缩放

3b6akqbq  于 2023-06-19  发布在  其他
关注(0)|答案(1)|浏览(142)

在流文档中有一个丑陋的缩放“特性”,你可以放大和缩小。我搜索了一下,找到了这个来删除它:

<FlowDocumentScrollViewer VerticalScrollBarVisibility="Hidden" FontSize="40">
        <FlowDocument>
            <!--content-->
        </FlowDocument>
</FlowDocumentScrollViewer>

但您仍然可以使用Ctrl+MouseWheel进行缩放。我能做些什么让它失效吗?

u7up0aaq

u7up0aaq1#

您可以将MinZoomMaxZoom设置为100:

<FlowDocumentScrollViewer VerticalScrollBarVisibility="Hidden"
                            FontSize="40" MinZoom="100" MaxZoom="100">
    <FlowDocument>
            <Paragraph>
                <Bold>Some bold text in the paragraph.</Bold>
                Some text that is not bold.
            </Paragraph>

            <List>
                <ListItem>
                    <Paragraph>ListItem 1</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>ListItem 2</Paragraph>
                </ListItem>
                <ListItem>
                    <Paragraph>ListItem 3</Paragraph>
                </ListItem>
            </List>
    </FlowDocument>
</FlowDocumentScrollViewer>

相关问题