找回密码
 立即注册

QQ登录

只需一步,快速开始

iceman
社区贡献组   /  发表于:2014-5-26 17:21:00
地板
回复 3楼tianyake的帖子

我通过附件使用 Spread Com 8.0 可以成功设置 ButtonCellType :

DataFill.zip (9.83 KB, 下载次数: 819)
回复 使用道具 举报
tianyake
注册会员   /  发表于:2014-5-23 21:24:00
板凳
单独设置某一个单元格为Button是没有问题的,但是在DataFill事件中设置是没有效果的

我现在就是想在绑定的时候根据数据来确定是否显示为Button
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-5-23 18:23:00
沙发
回复 1楼tianyake的帖子

请你尝试通过以下方法设置,看能否成功:

  1. ' Specify a cell
  2. fpSpread1.Col = 2
  3. fpSpread1.Row = 3
  4. ' Define cell type as button
  5. fpSpread1.CellType = CellTypeButton
  6. ' Insert picture in the cell
  7. fpSpread1.TypeButtonPicture = LoadPicture("C:\Samples\Files\CAMCORD.BMP")
  8. ' Set button text
  9. fpSpread1.TypeButtonText = "Manufacturer"
  10. ' Define the text color
  11. ' dark blue, RGB(0, 0, 128)
  12. fpSpread1.TypeButtonTextColor = &H800000
  13. ' Align text right and picture left
  14. fpSpread1.TypeButtonAlign = TypeButtonAlignRight
  15. ' Set the column width to display text and picture
  16. fpSpread1.ColWidth(2) = 15
  17. ' Set the row height to display entire picture
  18. fpSpread1.RowHeight(3) = 20

复制代码
回复 使用道具 举报
12
您需要登录后才可以回帖 登录 | 立即注册
返回顶部