回复 3楼Hjr2350的帖子
你好,
请使用以下代码测试:
- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.CellType.CheckBoxCellType ckbxcell = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
- ckbxcell.TextAlign = FarPoint.Win.ButtonTextAlign.TextRightPictLeft;
- ckbxcell.Caption = "Item Selected?";
- fpSpread1.Sheets[0].Cells[0, 0].CellType = ckbxcell;
- FarPoint.Win.Spread.Cell acell;
- acell = fpSpread1.ActiveSheet.Cells[0, 0];
- fpSpread1.ActiveSheet.Cells[0, 0].Text = "Note Test";
- acell.Note = "This is a note";
- fpSpread1.Sheets[0].Cells[0, 0, 3, 3].NoteStyle = FarPoint.Win.Spread.NoteStyle.PopupStickyNote;
- this.fpSpread1.AllowDrop = true;
- }
- private void fpSpread1_MouseMove(object sender, MouseEventArgs e)
- {
- FarPoint.Win.Spread.HitTestInformation test = fpSpread1.HitTest(e.X, e.Y);
- if (test==null||test.ViewportInfo==null)
- {
- return;
- }
- int row = test.ViewportInfo.Row;
- int col = test.ViewportInfo.Column;
- if (row==0&&col==0)
- {
- fpSpread1.Sheets[0].Cells[0, 0, 1, 1].NoteStyle = FarPoint.Win.Spread.NoteStyle.StickyNote;
- }
- else
- {
- fpSpread1.Sheets[0].Cells[0, 0, 1, 1].NoteStyle = FarPoint.Win.Spread.NoteStyle.Hidden;
- }
- }
复制代码 |