VB中的字符串有时太高了 [英] Strings are sometimes too tall in VB

查看:65
本文介绍了VB中的字符串有时太高了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

My problem is that in visual Basic application Strings are sometimes outside of control which they are meant for..........
is there a way to programmatically to
identify size of UI-component and the length of string concerned that UI-component so I know which strings are too tall to the compo-
nent in question

BR Jarppa

推荐答案

您可以测量宽度或使用TextRenderer类的字符串高度。你可以这样做,

You can measure the width or height of the string using TextRenderer class. You can do it as,


Dim textHeigth as Integer = TextRenderer.MeasureText("This is panel text", panel1.Font).Height


这篇关于VB中的字符串有时太高了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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