请问如何实现图片中的单元格效果。
目前尝试两种办法
1.
fpSpread1_Sheet1.Cells[1,1].CellType = new GcTextBoxCellType()
{
SideButtons = new SideButtonCollectionInfo()
{
new SideButtonInfo()
{
Enabled = true,
Interval = 1,
Text = "选",
ButtonWidth = 25
}
}
};
这种方式找不到接口响应Click事件
2.自定义单元格类型
public class ContentCellButton : FarPoint.Win.Spread.CellType.ButtonCellType
{
public override void PaintCell(System.Drawing.Graphics g, System.Drawing.Rectangle r,
FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
{
Rectangle _rectangle = new Rectangle(r.Right - 25, r.Y, 25, r.Height);
base.PaintCell(g, _rectangle, appearance, value, isSelected, isLocked, zoomFactor);
}
}
这种方式实现,当单元格选中时,按钮还是会覆盖整个单元格
|
-
效果图
|