使用RichTextCellType可以显示平方或者立方等指数形式的数据。代码如下:
- RichTextEditor editor = new RichTextEditor();
- editor.Text = "3";
- editor.SelectionCharOffset = -10;
- editor.SelectedText = "2";
-
- RichTextCellType type = new RichTextCellType();
-
- this.fpSpread1.ActiveSheet.Cells[1, 1].CellType = type;
- this.fpSpread1.ActiveSheet.Cells[1, 1].Value = editor.Rtf;
复制代码
效果如下: