获取单元格设置了WrapText的行的高度 [英] Get height of row where the cells have WrapText set
问题描述
我正在尝试计算要插入到Excel工作表中的行的高度.该行的单元格使用WrapText=true
格式化,因此该行的高度不是固定的.
访问row.Height将返回null.
I am trying to compute the height of the row I'm inserting into my excel sheet. The row's cells are formatted with WrapText=true
, so the height of the row is not fixed.
Accessing row.Height will return null.
我当时正在考虑使用类似于Graphics.MeasureString
的方式,其中我还指定了宽度约束以获取高度.
I was thinking of using something similar to Graphics.MeasureString
where I also specify the width constraint in order to retrieve the height.
找不到在线任何相关信息.任何帮助将不胜感激.
Didn't find any relevant info online. Any help would be appreciated.
推荐答案
在此处使用Graphics.MeasureString查看我的帖子.效果很好.
See my post here using Graphics.MeasureString. It works very well.
这篇关于获取单元格设置了WrapText的行的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!