createIcon / drag and drop

I want to copy a node from one GoView to another GoView.
If I drag it from GoView1 and drop it to GoView2, then I get automatically a copy in GoView2.

Our Problem is now, we overload overrides the createIcon() function. All own objects in this function have no reference (after copy). So if I change the color (myGoRectangle.BrushColor) from the node in GoView2 (copy) it will change the node in GoView1 (original).

When I set the toplabel from this node (copy), then it will change the label of the copy.

Protected Overloads Overrides Function CreateIcon(ByVal res As System.Resources.ResourceManager, ByVal iconname As String) As GoObject

    myGoRectangle.Selectable = False
    myGoRectangle.ResizesRealtime = True
    myGoRectangle.PenColor = Color.Transparent
    myGoRectangle.BrushColor = Color.White

   '....

    Return ('.....
End Function

Try something like this in your node: (if your node class was “MyNode”)

protected override void CopyChildren(GoGroup newgroup, GoCopyDictionary env) {
  base.CopyChildren(newgroup, env);
  MyNode newobj = (MyNode)newgroup;
  newobj.<span style=": rgb248, 248, 252; ">myGoRectangle</span>= (<span style=": rgb248, 248, 252; ">GoRectangle</span>)env[<span style=": rgb248, 248, 252; ">myGoRectangle</span>];
}

We use GoGeneralNode… what can i try with this class?

It looks (from the myGoRectangle) that you must have subclassed GoGeneralNode. The code above is an override to add to that class.

it works, thanks!

protected override void CopyChildren(GoGroup newgroup, GoCopyDictionary env) {
base.CopyChildren(newgroup, env);
MyNode newobj = (MyNode)newgroup;
newobj.myGoRectangle= (GoRectangle)env[myGoRectangle];
}