找回密码
 立即注册

QQ登录

只需一步,快速开始

beal_p

注册会员

2

主题

4

帖子

20

积分

注册会员

积分
20
最新发帖
beal_p
注册会员   /  发表于:2016-11-24 08:30  /   查看:3025  /  回复:3

如winform上普通按钮的话,我设置了BackColor为红色的话,看上去,这个按钮就是红色的了

不过,在spread里的button, 通过何种方法,能实现其背景色的显示呢?

3 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-11-24 18:41:45
沙发
设置button celltype 的button color
  1. FarPoint.Win.Spread.CellType.ButtonCellType bttncell = new FarPoint.Win.Spread.CellType.ButtonCellType();
  2. bttncell.ButtonColor = Color.Cyan;
  3. bttncell.DarkColor = Color.DarkCyan;
  4. bttncell.LightColor = Color.AliceBlue;
  5. bttncell.ShadowSize = 3;
  6. bttncell.Text = "Click and hold...";
  7. bttncell.TextDown = "...you can see how words go to multiple lines. Now let go.";
  8. bttncell.TextColor = Color.Green;
  9. bttncell.WordWrap = true;
  10. bttncell.UseVisualStyleBackColor = false;
  11. fpSpread1.Sheets[0].Cells[3,2].CellType = bttncell;
复制代码
回复 使用道具 举报
beal_p
注册会员   /  发表于:2016-11-25 11:36:43
板凳
dexteryao 发表于 2016-11-24 18:41
设置button celltype 的button color

非常感谢,原来关键点在bttncell.UseVisualStyleBackColor = False 上。

已解决。
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-11-25 16:15:37
地板
是的,这个一定要设置。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部