回答1、Note内容可以在设计器中修改其样式,也可以通过代码修改:
- fpSpread1.Sheets[0].AllowNoteEdit = true;
- fpSpread1.Sheets[0].Cells[1, 1].Note = "test";
- fpSpread1.Sheets[0].Cells[1, 1].NoteIndicatorColor = Color.Green;
- fpSpread1.Sheets[0].Cells[1, 1].NoteStyle = FarPoint.Win.Spread.NoteStyle.StickyNote;
- fpSpread1.Sheets[0].SetStickyNoteStyleInfo(1, 1, new FarPoint.Win.Spread.DrawingSpace.StickyNoteStyleInfo() { ForeColor = Color.Red });
复制代码
回答2、Spread没有直接提供类似的显示方式,可以通过结合相应事件来实现该功能:
- private void fpSpread1_EnterCell(object sender, EnterCellEventArgs e)
- {
- if (!String.IsNullOrEmpty(fpSpread1.ActiveSheet.ActiveCell.Note))
- {
- fpSpread1.ActiveSheet.ActiveCell.NoteStyle = NoteStyle.StickyNote;
- }
- }
- private void fpSpread1_LeaveCell(object sender, LeaveCellEventArgs e)
- {
- if (!String.IsNullOrEmpty(fpSpread1.ActiveSheet.ActiveCell.Note))
- {
- fpSpread1.ActiveSheet.ActiveCell.NoteStyle = NoteStyle.Hidden;
- }
- }
复制代码 |