【发布时间】:2015-02-10 00:50:39
【问题描述】:
在 Spreadsheetgear 中,我可以右键单击一个单元格并选择“编辑评论”。 我想从代码中做同样的事情。但我只看到一个“IRange.AddComment”方法,没有“EditComment”...... 有可能吗?
【问题讨论】:
标签: spreadsheetgear
在 Spreadsheetgear 中,我可以右键单击一个单元格并选择“编辑评论”。 我想从代码中做同样的事情。但我只看到一个“IRange.AddComment”方法,没有“EditComment”...... 有可能吗?
【问题讨论】:
标签: spreadsheetgear
以您所说的方式编辑单元格注释纯粹是与 UI 相关的任务(可能来自 WorkbookView 控件之一),因此您不会在 SpreadsheetGear 的“核心”中看到任何“EditComment”类型的 API " API 如IRange 接口。
相反,您需要在选择所需的注释形状时在 WorkbookView 上调用 BeginEdit() 方法。下面是一些示例代码来演示这一点:
// Assuming there's a comment in A1...
SpreadsheetGear.IComment comment = workbookView.ActiveWorksheet.Cells["A1"].Comment;
// Ensure the comment is visible.
comment.Visible = true;
// Select it.
comment.Shape.Select(true);
// Tell the WorkbookView to enable "edit mode" on the currently selected
// item, which in this case we know is the cell comment in A1.
workbookView.BeginEdit();
【讨论】: