FarPoint自动换行

单元格自动换行

FarPoint.Win.Spread.CellType.TextCellType mType = new FarPoint.Win.Spread.CellType.TextCellType();
mType.WordWrap = true;   //自动换行
mSheet.Columns[iColumn].CellType = mType;

自动换行后,还需要通过代码调整行高,以便显示全部内容

mSheet.Rows[i].Height = mSheet.Rows[i].GetPreferredHeight();
if (mSheet.Rows[i].Height < 28) { mSheet.Rows[i].Height = 28; }

另外,GetPreferredHeight只能是当前行,在合并行的情况下无法自动计算合适的行高,依然是单行的行高。

原文地址:https://www.cnblogs.com/imhuanxi/p/11028833.html