Drawing ellipse on node

Hello!

Help me, please, to do this operation:

is there any easy way to draw something like a weak red circle above node when I select it and delete it when selection is finished? (If another vertex is selected after that, draw it above the another vertex)

For better explanation I attach a screenshot.

Add this override to your node class will give you a circle around your node

public override IGoHandle CreateBoundingHandle()
{
  GoHandle h = new GoHandle();
  h.Style = GoHandleStyle.Ellipse;
  RectangleF rect = this.Bounds;
  // the handle rectangle should just go around the object
  SizeF margin = new SizeF(7, 7);
  InflateRect(ref rect, margin.Width, margin.Height);
  h.Bounds = rect;
  return h;
}

public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj)
{
  RemoveSelectionHandles(sel);

  GoView view = sel.View;
  bool viewresize = (view == null || view.CanResizeObjects());
  bool viewreshape = (view == null || view.CanReshapeObjects());

  if (!(CanResize() && viewresize))
  {
    IGoHandle handle = sel.CreateBoundingHandle(this, selectedObj);
    GoObject hobj = handle.GoObject;
    if (hobj == null) return;
     GoShape hshape = hobj as GoShape;
     if (hshape != null)
     {
       hshape.BrushColor = Color.FromArgb(100, Color.Pink);
     }
       return;
  }

  base.AddSelectionHandles(sel, selectedObj);
}

internal static void InflateRect(ref RectangleF a, float w, float h)
{
  a.X -= w;
  a.Width += w * 2;
  a.Y -= h;
  a.Height += h * 2;
}

Note I set the Pink fill to have an alpha to make it a bit transparent. The handle is on top of the object, so this trick makes the node still visible.

For links, you can set:

link.HighlightPenWidth = 5;
link.HighlightPenColor = some color
link.HighlightWhenSelected = true;

You can set view.NewLinkPrototype to set these properties in the default link.

Thank you, Jake, but there is one little problem:

when I select the second vertex, second pink circle appears, but first one does not disappear. It also does not disappear as I click on background

I solved this problem myself, thank you