Windows CE 5.0中文本框的高度字体 [英] height font of a textbox in Windows CE 5.0
问题描述
我需要(在C#或VB.net中)获取文本框控件的此属性值: textBox1.Font.Height
I need (in C# or VB.net) to get this atribute value of a textbox control: textBox1.Font.Height
如何获取此值在Windows CE?是否有解决方法可以获得它?
How can I get this value in Windows CE? Is there som workaround to get it?
谢谢大家。
推荐答案
你可以 使用System.Drawing.Graphics.MeasureString( https://msdn.microsoft。 com / en-us / library / 6xe5hazb(v = vs.90).aspx) 近似值
You could use System.Drawing.Graphics.MeasureString (https://msdn.microsoft.com/en-us/library/6xe5hazb(v=vs.90).aspx) to approximate the value
或
调用本机API(P / Invoke)GetTextMetrics( https://msdn.microsoft.com/en -us / library / ms901139.aspx)
此API可以为您提供所需的所有信息。
call the native API (P/Invoke) GetTextMetrics (https://msdn.microsoft.com/en-us/library/ms901139.aspx)
This API sould give you all Information you need.
这篇关于Windows CE 5.0中文本框的高度字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!