字符串长度(英寸) [英] String length in inches

查看:92
本文介绍了字符串长度(英寸)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

   我必须将各种长度的字符串放入固定宽度的文本框中。我打算通过更改字体大小来做到这一点,但我想要尽可能的最大尺寸。 字符长度因字符而异(Courier太宽了
)。 有没有办法以英寸或任何度量单位来衡量字符串的长度,无论字体是什么?

解决方案

为什么以英寸为单位,那里不是任何具有控制尺寸的计算机格式,以英寸为单位。 


文本框总是以分数完成。 


https://msdn.microsoft。 COM / EN-US /库/ system.drawing.graphics.measurestring(v = vs.110)的.aspx


   I have to fit strings of various lengths into a fixed width text box. I intend to do this by changing the font size, but I want the maximum size possible.  Length in characters varies depending on the characters (Courier is way too wide to use).  Is there a way to measure the length of a string in inches, or any unit of measure, regardless of the font?

解决方案

Why in inches, there is not any computer format which has controls which size are done in inches. 

Textboxes are always done in points. 

https://msdn.microsoft.com/en-us/library/system.drawing.graphics.measurestring(v=vs.110).aspx


这篇关于字符串长度(英寸)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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