用户定义带有文本框和标签的控件 [英] User Define Control with textbox and label

查看:80
本文介绍了用户定义带有文本框和标签的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,
我正在开发用户定义控件,我想在项目中使用控件时调整控件的大小,但无法调整文本框的大小,但可以调整控件的大小
如何在设计时调整文本框的大小.
请重新输入.

Dear Sir,
I am developing user define control and i want to resize the control when i use in my project but i am not able to resize the textbox but i can resize the control
how to resize the textbox on design time.
Please repply.

推荐答案

除非您使用的是WPF,否则文本框在垂直方向上无法很好地调整大小-字体大小是固定的,并且可以不会相对于控件高度自动变化.如果要更改文本大小(这是更改单行文本框高度的唯一实用方法),则需要处理Controls SizeChanged事件并自行更改字体大小.
水平调整大小只是正确设置Anchor属性的一种情况.
Unless you are using WPF, textboxes don''t resize well vertically - the font size is fixed, and does not vary automatically relative to the control height. If you want the text to change size (which is the only practical way to change the height of a single line text box) then you will need to handle the Controls SizeChanged event and alter the font size yourself.
Resizing it horizontally is just a case of setting the Anchor property correctly.


这篇关于用户定义带有文本框和标签的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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