找回密码
 立即注册

QQ登录

只需一步,快速开始

zhq888888

高级会员

3

主题

5

帖子

1425

积分

高级会员

积分
1425

活字格认证

最新发帖
zhq888888
高级会员   /  发表于:2013-7-1 14:21  /   查看:4876  /  回复:3
检索完之后,我不想在spread的中设的光标,但是它检索完之后spread锁定了,光标定在第一条,我现在不需要光标在spread中。

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-7-1 18:07:00
沙发
回复 1楼zhq888888的帖子

请问您指的“检索”完是指什么操作?可以使用 Focus() 方法把焦点设置到其他控件。
回复 使用道具 举报
zhq888888
高级会员   /  发表于:2013-7-2 08:59:00
板凳
回复 2楼iceman的帖子

就是光标不显示在spread,
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2013-7-2 19:03:00
地板
回复 3楼zhq888888的帖子

可以使用自定义 Indicator 来隐藏光标,测试代码:

  1.     public partial class Form1 : Form
  2.     {
  3.         public Form1()
  4.         {
  5.             InitializeComponent();
  6.         }

  7.         private void Form1_Load(object sender, EventArgs e)
  8.         {
  9.             this.fpSpread1.Sheets[0].SetActiveCell(-1, -1);

  10.             fpSpread1.FocusRenderer = new MyIndicator();
  11.         }
  12.     }

  13.     public class MyIndicator : FarPoint.Win.Spread.IFocusIndicatorRenderer
  14.     {

  15.         public void Paint(System.Drawing.Graphics g, int x, int y, int width, int height, bool left, bool top, bool right, bool bottom)
  16.         {

  17.             SolidBrush r = new SolidBrush(System.Drawing.Color.Gray);

  18.             SolidBrush b = new SolidBrush(System.Drawing.Color.Gray);

  19.             SolidBrush gr = new SolidBrush(System.Drawing.Color.Gray);

  20.             g.FillRectangle(r, x, y, 1, height);

  21.             g.FillRectangle(gr, x, y, width, 1);

  22.             g.FillRectangle(r, x + width - 1, y, 1, height);

  23.             g.FillRectangle(b, x, y + height - 1, width, 1);

  24.         }

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