GoStroke

I have a question regarding the link between two nodes. What method should I override in order to set the shaft color or arrow type depending on parameters set in my node class? The node class is derived from GoSimpleNode.

Relating this example to protoapp: say you wanted a red line if linking Sun to Cloud, a blue line with an arrow head if linking Rocket to Sun - bit silly but illustrates the point I think Embarrassed

If you are creating links programmatically, you would be constructing the links and initializing them the way you want.

So I assume you are asking about how to customize the links that are drawn by the user. Just define a GoView.LinkCreated event handler. To implement your example:
[code] private void goView1_LinkCreated(object sender, Northwoods.Go.GoSelectionEventArgs e) {
GoLink link = e.GoObject as GoLink;
if (link != null) {
GraphNode from = link.FromNode as GraphNode;
GraphNode to = link.ToNode as GraphNode;
if (from != null && to != null) {
if (from.Image.Name == "sun.ico" && to.Image.Name == "cloud.ico") {
link.Pen = Pens.Red;
} else if (from.Image.Name == "rocket.ico" && to.Image.Name == "sun.ico") {
link.ToArrow = true;
link.Pen = Pens.Blue;
}
}
}
}[/code]
Of course in your application you will have a different way to recognize the type of node. In ProtoApp, the only way to tell if it's a "Sun" node is by looking at what image it is showing. The label is editable by the user, so its text would not be reliable.

Thank you, I had been on the right lines only Visual Studio ‘designer’ had put the adding of the event handler
this.LinkCreated += new GoSelectedEventHandler()
into InitialiseComponent() and it wasn’t getting called
Turns out, putting it into the GoView class constructor is the solution.
Also, for completeness first line needs to be:
GraphLink link = e.GoObject as GraphLink (which is derived from GoLink … Smile)
Many thanks for your help Walter.