Multi color links off of single node

Hi, right now i’m basically working off of the flow charter example, along with an add in or two from another project, mainly the FlowLink class. what i need to be able to do is draw links from one node to other nodes(works fine), then once all the linking is done, the user needs to be able to right click on the link, and be able to change its color i.e. a “make red” function in the context menu (the menu works fine and the color changes) but the really neat part, is that every other link changes color too, right now i use an even handler that is wired to the context menu which basically does: this.Pen.Color=Color.Crimson; this.CalculateStroke(); i call calculateStroke() because it was the only way i could think of to force the redraw of the link so the color would change w/out the user moving something in the document. Oh, all of this is in the FlowLink class. Now what i need is a way to allow the links to be multiple colors, and to only change the color when the user uses the context menu, and leave the links black when they’re drawn. I hope somebody can help.

Edit: I’m using GoDiagram 2.4.1(and i fixed some typos). I’ve also tried using [current view].Selection.Primary to just change the color for that link, which didnt work mabye i did something wrong. and i’ve tried to use the from node’s destination link collection to find the link i want and change its color, which i’m pretty sure i did wrong as i kept getting an error, but i dont think these two methods are very dissimilar, so i doubt using the destination links collection would work even if i did do it right. any help from anyone would be great, i just need to set the link color independantly of the other links.

Thanks
john

Looks like you are sharing a Pen between all the links, you need to allocate a new one.

You can use Invalidate to force a refresh, but replacing the Pen ought to do that too.

Jake

Great it worked perfectly, thanks a lot. btw, i have a list of numbers in the context menu, is there a way for me to know what number they selected in the menu, aside from having a different function for each item? i’d like to use the same function for each, but i need a way to know if the function got called from the ‘1’ menu item or the ‘7’ menu item.

never mind, i’m casting sender as menuitem and using the text property for now, if there is a better way(there usually is with my code) please let me know.