Redrawing/Refreshing current items in Go Document

Hey Walter! Or anyone that might know. I have a Link that needs to be redrawn on my current Go Document once another color is set to it, and I can’t figure out how. I’m trying to actually repaint from the link object itself. The reason I’m trying to do that is that I’m setting the properties of the link through a context menu selection. I also thought about updating it on the goView, but what event would I look for if I wanted the goView to handle the repainting. Thanks!

When you set the GoShape.Pen property (or the GoShape.Brush property), it will automatically repaint the shape in all views that are showing the shape.

Remember that in .NET you cannot modify a Pen or Brush once you have started using it. For GoDiagram, that means once you have assigned one of the Pen or Brush properties.

Woohoo! I got it to work. So from what you told me I was able to do this with my link object.


        public void OpenLinkTypeForm(Object sender, EventArgs e)
        {
            SetLinkType lt = new SetLinkType(FromSysid, ToSysid);
            if (lt.ShowDialog() == DialogResult.OK)
            {
                this.ccode = lt.ccode;
                this.SetLinkStyle();
            }

        }

        public void SetLinkStyle()
        {
            Pen p = new Pen(ReturnColor(), 2);
            this.Pen = p;
            this.HighlightPen = new Pen(Color.White, 6);
            this.Highlight = true;
        }

So I have a form that my users select a code for the link. And like it stores the code in its object so I can call it from the link where I can then set the color based on the code selected. Thanks a lot Walter!