[WPSL]在某些对象中设置宽度/高度的最大值 [英] [WPSL]Setting a maximum value for width/height in certain objects

查看:78
本文介绍了[WPSL]在某些对象中设置宽度/高度的最大值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

窗体或Windows手机应用程序设计中的这个问题可能确实存在问题,因为很难设置某个对象以适应设备的最大高度或宽度。


i知道你必须将对象的对齐方式设置为"拉伸"。并且宽度/高度为"auto"。但对于scrollviewers和TextBlocks,它只会自动适合内容而不是设备。


是否有值将高度/宽度设置为最大值(如"max"或东西)?如果没有另外的方法。


早谢谢

解决方案

嗨德里克,


使用C#或VB
论坛构建Windows应用商店应用即将退休!
  ;我将把它移到Building Universal Windows应用程序论坛。请阅读  欢迎
到开发通用Windows应用论坛!


你的类型是什么?应用程序吗?请参阅此处   发布指南:
主题行标签
 更改标题


>>是否有值将高度/宽度设置为最大值(如"max"或类似物)?如果没有另外的方法。


如果我没有误解,
FrameworkElement.MaxHeight

FrameworkElement.MaxWidth
属性应该是你的样子这些属性可以设置从FrameworkElement类继承的控件的最大高度/宽度,如TextBlock,ScrollViewer。



This problem in form or Windows phone application design can be really problematic because is hard to set a certain object to fit the maximum height or width of a device.

i know that you have to set the alignment of the object to "Stretch" and the width/height to "auto". But for scrollviewers and TextBlocks, it will just automatically fit to the content instead of the device.

Is there a value to set the height/width to the maximum(Like "max" or something)? If not is there an alternate way.

Early Thanks

解决方案

Hi Derrick,

The Building Windows Store apps with C# or VB forum is retiring! I'll move this to the Building Universal Windows apps forum for you. Please read Welcome to the Developing Universal Windows apps forum!.

What's the type of your app? Please see here  Guide to posting: subject line tags to change your title

>>Is there a value to set the height/width to the maximum(Like "max" or something)? If not is there an alternate way.

If I'm not misunderstanding, the FrameworkElement.MaxHeight and FrameworkElement.MaxWidth property should be what you are looking for.

These properties can set the maximum height/width for controls inherited from FrameworkElement class, like TextBlock, ScrollViewer.


这篇关于[WPSL]在某些对象中设置宽度/高度的最大值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆