在代码后面获取面板高度 [英] Get Panel height in code behind

查看:103
本文介绍了在代码后面获取面板高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在后面的代码中获取面板高度?

How to get Panel height in code behind ?

推荐答案

如上所述,myPanel.Height是方法.

在此处查看面板的所有属性: MSDN:面板 [^ ]
As stated, myPanel.Height is the way.

Look here for all the properties of a Panel: MSDN: Panel[^]


Kabeer,
这是我的情况...

在按钮单击事件中,在文本框中输入的字符将显示在标签中.标签的宽度固定为ex,200px,但未设置标签的高度.

通过更改文本框中的字符,并触发按钮单击事件,标签将使用文本框中的文本填充.那时,标签的宽度将保持不变,但高度将根据在文本框中输入的字符数而动态变化.....

在这里,我需要获取按钮单击事件上的标签高度(以像素为单位)???????

在此先感谢您,有人可以帮忙吗????
Hi Kabeer,
Here is my scenario...

The characters that are entered in the text box will be displayed in the label at the button click event. Label is having fixed width for ex,200px but the height is not set for the label.

By changing the characters in the text box,and firing the button click event the label will get populated with the text from the text box. At that time label width will be constant but height will change dynamically according to the no of characters entered in the textbox.....

Here I need to get the label height in pixels on the button click event???????

Thanks in Advance ?Can Anyone help me????


这篇关于在代码后面获取面板高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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