回复 3楼zhq888888的帖子
可以使用自定义 Indicator 来隐藏光标,测试代码:
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- this.fpSpread1.Sheets[0].SetActiveCell(-1, -1);
- fpSpread1.FocusRenderer = new MyIndicator();
- }
- }
- public class MyIndicator : FarPoint.Win.Spread.IFocusIndicatorRenderer
- {
- public void Paint(System.Drawing.Graphics g, int x, int y, int width, int height, bool left, bool top, bool right, bool bottom)
- {
- SolidBrush r = new SolidBrush(System.Drawing.Color.Gray);
- SolidBrush b = new SolidBrush(System.Drawing.Color.Gray);
- SolidBrush gr = new SolidBrush(System.Drawing.Color.Gray);
- g.FillRectangle(r, x, y, 1, height);
- g.FillRectangle(gr, x, y, width, 1);
- g.FillRectangle(r, x + width - 1, y, 1, height);
- g.FillRectangle(b, x, y + height - 1, width, 1);
- }
- }
复制代码 |