【问题标题】:WPF: How do I obtain the size of the visible portion of a TextBox in a TreeView (see image)?WPF:如何获取 TreeView 中 TextBox 可见部分的大小(见图)?
【发布时间】:2011-10-11 15:10:15
【问题描述】:

有没有办法在 TreeView 中获取 WPF UI 控件(例如 TextBox)可见部分的大小?

例如,在这张图片中,我想要粉红色文本框的可视部分的大小:

【问题讨论】:

    标签: .net wpf


    【解决方案1】:

    这不是重复的吗?

    How do I get the size of the visible part of a WPF usercontrol?

    无论如何:您可以通过IScrollInfo 进行操作

    【讨论】:

    • 1- 在您链接的问题中,my 问题的答案在哪里?和 2- 我如何使用 IScrollInfo 来获得我想要的?
    • 那么如何使用IScrollInfo获取文本框显示部分的大小呢?
    • ViewportHeight & ViewportWidth 将为您提供 ViewPort 大小(可见大小)。这些是 IScrollInfo 的属性。
    猜你喜欢
    • 2011-09-01
    • 2012-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多