单元格自动换行

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只能是当前行,在合并行的情况下无法自动计算合适的行高,依然是单行的行高。

相关文章:

  • 2021-09-28
  • 2022-01-05
  • 2022-02-07
  • 2022-01-10
  • 2022-02-23
  • 2021-07-21
  • 2021-11-27
  • 2021-12-16
猜你喜欢
  • 2022-02-04
  • 2021-11-26
  • 2022-01-06
  • 2021-05-23
  • 2021-08-28
  • 2021-11-28
相关资源
相似解决方案