在WPF中调整控件的大小 [英] Resizing a control in WPF

查看:489
本文介绍了在WPF中调整控件的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在wpf表单中有一组用户控件,并且希望让用户能够调整它们的大小。每当用户单击控件时,应总共显示8个边界矩形,然后拖动它们中的任何一个,则用户必须能够调整控件的大小。

解决方案

我制作了



主页上有一个快速的gif视频显示它行动中。



非常简单,只需调用一行代码即可。

  / /将最大调整大小设置为最大高度200像素,最大宽度300像素。 
新的CResizeAdorner(button1、200、300);


I have a set of user controls in my wpf form and want to give ability to user to resize them. Whenever a user clicks on a control total 8 boundary rectangles should appear and then by dragging any of them, the user must be able to resize the control. Please help me on this.

解决方案

I made a library that applies resize grips to any control.

Homepage has a quick gif video showing it in-action.

Very simple, just call one line of code.

//Set max resize to 200px max height, 300px max width.
new CResizeAdorner(button1, 200, 300); 

这篇关于在WPF中调整控件的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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