找回密码
 立即注册

QQ登录

只需一步,快速开始

流水止于天

中级会员

6

主题

14

帖子

642

积分

中级会员

积分
642

活字格认证

流水止于天
中级会员   /  发表于:2013-11-4 14:22  /   查看:6049  /  回复:6
谢谢了!!!!!

6 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-11-4 15:42:00
沙发
回复 1楼流水止于天的帖子

可以通过单元格的 Locked 属性来控制:

  1.         private void Form1_Load(object sender, EventArgs e)
  2.         {
  3.             FarPoint.Win.Spread.CellType.CheckBoxCellType ckbxcell = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
  4.             ckbxcell.TextAlign = FarPoint.Win.ButtonTextAlign.TextRightPictLeft;
  5.             ckbxcell.Caption = "Item Selected?";
  6.             fpSpread1.Sheets[0].Cells[2, 2].CellType = ckbxcell;
  7.             fpSpread1.Sheets[0].Cells[2, 2].Locked = true;


  8.         }
复制代码
回复 使用道具 举报
流水止于天
中级会员   /  发表于:2013-11-4 15:55:00
板凳
回复 2楼iceman的帖子

试一下 谢谢了
回复 使用道具 举报
流水止于天
中级会员   /  发表于:2013-11-4 16:00:00
地板
回复 2楼iceman的帖子

不好意思,我没说清楚。还有一个全选按钮,点击按钮所有的CheckBox都会被选中,用LOCKED不可以。请问还有其他的方法吗?
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2013-11-4 18:51:00
5#
回复 4楼流水止于天的帖子

那只能抓取 CheckBox 的点击事件,再充值单元格方法:

  1. private void Form1_Load(object sender, EventArgs e)
  2.         {
  3.             FarPoint.Win.Spread.CellType.CheckBoxCellType ckbxcell = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
  4.             ckbxcell.TextAlign = FarPoint.Win.ButtonTextAlign.TextRightPictLeft;
  5.             ckbxcell.Caption = "Item Selected?";
  6.             fpSpread1.Sheets[0].Cells[2, 2].CellType = ckbxcell;

  7.             ckbxcell.EditorValueChanged += new EventHandler(ckbxcell_EditorValueChanged);



  8.         }

  9.         void ckbxcell_EditorValueChanged(object sender, EventArgs e)
  10.         {
  11.             this.fpSpread1.Sheets[0].ActiveCell.Value = false;
  12.         }
复制代码

弊端是可以看到选中状态。
回复 使用道具 举报
流水止于天
中级会员   /  发表于:2013-11-5 08:27:00
6#
回复 5楼iceman的帖子

谢谢
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2013-11-5 10:54:00
7#
回复 6楼流水止于天的帖子

不客气,有问题欢迎开新帖提问。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部