回复 1楼Hjr2350的帖子
可以通过 Shape 的 Changed 事件获取。测试代码:
- private void Form1_Load(object sender, EventArgs e)
- {
- System.Drawing.Point[] pts = {new System.Drawing.Point(25, 0),
- new System.Drawing.Point(0, 50),
- new System.Drawing.Point(20, 50),
- new System.Drawing.Point((int)2.5, 100),
- new System.Drawing.Point(40, 40),
- new System.Drawing.Point(20, 40),
- new System.Drawing.Point(40, 0),
- new System.Drawing.Point(25, 0)};
- System.Drawing.Drawing2D.GraphicsPath gpath = new System.Drawing.Drawing2D.GraphicsPath();
- gpath.AddPolygon(pts);
- FarPoint.Win.Spread.DrawingSpace.PSShape pso = new FarPoint.Win.Spread.DrawingSpace.CustomShape();
- pso.BackColor = Color.Black;
- pso.AlphaBlendBackColor = 90;
- pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical;
- pso.CanRotate = true;
- pso.CanSize = FarPoint.Win.Spread.DrawingSpace.Sizing.HeightAndWidth;
- pso.Shape = gpath;
- pso.SetBounds(250, 250, 120, 120);
- fpSpread1.ActiveSheet.AddShape(pso);
- pso.Changed += new EventHandler(pso_Changed);
- }
- void pso_Changed(object sender, EventArgs e)
- {
- }
- }
复制代码 |