在状态栏中选择下拉列表的值时,将调整表单大小. [英] Form resize on selecting value of Dropdown in Status Bar.

查看:113
本文介绍了在状态栏中选择下拉列表的值时,将调整表单大小.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在表单状态栏中添加调整大小下拉菜单.以及如何在选定的下拉索引上设置值以调整表单大小.例如150%,100%,80%,60%.

How to add resize drop down in form status bar. And how to set value on selected index of drop down for resize the form size. Ex 150%, 100%, 80%, 60%.

推荐答案

这并不像听起来那样简单,因为逻辑潜能很小.首先,调整大小的基础是什么.换句话说,您将使用什么尺寸作为调整大小的起点?显然,您不能仅仅保持相对于当前大小的大小调整,因为这种影响是累积性的.

从理论上讲,我将通过为表单的高度和宽度创建一个ValueConverter来做到这一点.在该转换器中,我将具有表单的基本尺寸.然后,我将使用组合中更改的选择来实际触发该大小更改.这样,您几乎可以完全通过XAML维护绑定.
This isn''t as simple as it sounds because of a tiny little wrinkle in the logic potential. First of all, what''s the basis of the resizing size. In other words, what size are you going to use as the starting point for the resize? Obviously you can''t just keep resizing relative to the current size because the effects would be cumulative.

Theoretically, I would do this by creating a ValueConverter for the height and width of the form. In that converter, I would have the basic dimensions of the form. Then I would use the selection changed in the combo to actually trigger that size change. This way, you can maintain the binding entirely virtually entirely through your XAML.


在选择更改的处理程序中,将元素的DesiredSize属性乘以选定的百分比.
In your selection changed handler, multiply the DesiredSize property of the element by the selected percentage.


这篇关于在状态栏中选择下拉列表的值时,将调整表单大小.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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