转换DataTable列宽(以像素为单位) [英] Convert DataTable column width in pixels

查看:87
本文介绍了转换DataTable列宽(以像素为单位)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我们假设我知道一个DataTable列宽(从sql server nvarchar获得的字符数)

Let us suppose I know a DataTable column width (number of characters got from sql server nvarchar)

现在我需要转换此宽度(字符) 以像素为单位使用Segue UI字体

Now i need to convert this width (characters)  in pixels using Segue UI font

如何转换它?

推荐答案

从中创建一个Font实例该名称然后使用TextRender.MeasureString与您创建的字符串和字体。
Create an instance of the Font from the name then use TextRender.MeasureString with the string and the font you created.


这篇关于转换DataTable列宽(以像素为单位)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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