【问题标题】:Making the MainWindow resizeable but having the contents inside resize with it使 MainWindow 可调整大小,但内部的内容也随之调整大小
【发布时间】:2013-10-18 18:23:51
【问题描述】:

我需要使我的主窗口可调整大小.. 但如果里面的内容不随它缩放,调整它的大小是没有意义的.. 我用谷歌搜索并没有找到太多.. 我确实找到了这个:

它不起作用..我试过这个:

<Window.RenderTransform>
    <ScaleTransform ScaleX="0.8" ScaleY="0.8" />
</Window.RenderTransform>

并在这里尝试了这个网站

http://inchoatethoughts.com/scaling-your-user-interface-in-a-wpf-application

但即使从一个空白项目尝试,由于某种原因它也不起作用=T

编辑:我认为棘手的是我有两组网格。第一个网格用于模拟标题栏,第二个网格用于其余内容

【问题讨论】:

标签: c# wpf scaletransform


【解决方案1】:

我会使用ViewBox

<Window>
    <Viewbox>
        ... your Content
    </Viewbox>
</Window>

请参阅Stretch Property Enumeration 了解几个扩展选项。

【讨论】:

  • 搞砸了,但它真的不能满足我的需要
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-02-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多