找回密码
 立即注册

QQ登录

只需一步,快速开始

iceman

社区贡献组

270

主题

1万

帖子

1万

积分

社区贡献组

积分
19311

活字格认证微信认证勋章元老葡萄

iceman
社区贡献组   /  发表于:2014-4-4 13:46  /   查看:4137  /  回复:0
问题描述:如何获取ComoboCellType的选择事件,改变单元格的背景色。
问题解答:ComoboCellType提供了EditorValueChanged事件用于捕获选择事件。
关键代码:

  1.         ///<summary>
  2.         ///添加 ComboBoxCellType 单元格类型
  3.         ///</summary>
  4.         private void AddCellType()
  5.         {
  6.             FarPoint.Win.Spread.CellType.ComboBoxCellType comboBoxCellType1 = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
  7.             comboBoxCellType1.Items = (newString[] { "红色", "绿色", });
  8.             fpSpread1.Sheets[0].Cells[0, 0].CellType = comboBoxCellType1;
  9.             comboBoxCellType1.EditorValueChanged += newEventHandler(comboBoxCellType1_EditorValueChanged);
  10.         }
复制代码


源码下载:
VS  版本:2010
.NET版本: 2.0
点击下载

效果截图:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部