Article | 60000151 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 5/16/2007 |
Submitted by | Pedro Godinho |
Keywords |
private void Form1_Load(object sender, EventArgs e) { AddLayoutEntities(); vdSC.BaseControl.vdMouseClick += new VectorDraw.Professional.Control.MouseClickEventHandler(BaseControl_vdMouseClick); } void BaseControl_vdMouseClick(MouseEventArgs e, ref bool cancel) { VectorDraw.Professional.vdPrimaries.vdFigure fig; VectorDraw.Geometry.gPoint pt = vdSC.BaseControl.ActiveDocument.CursorPosCCS(e.Location); VectorDraw.Geometry.gPoint p1 = vdSC.BaseControl.ActiveDocument.World2PixelMatrix.Transform(pt as VectorDraw.Geometry.gPoint); Point location = new Point((int)p1.x, (int)p1.y); fig = vdSC.BaseControl.ActiveDocument.ActiveLayOut.GetEntityFromPoint(location, vdSC.BaseControl.ActiveDocument.ActiveLayOut.Render.GlobalProperties.PickSize, false); if (fig == null) { vdPGrid.SelectedObject = vdSC.BaseControl.ActiveDocument; this.Text = "NO Entity clicked"; } else { vdPGrid.SelectedObject = fig; this.Text = "Entity clicked"; } }