Synchronized Scrolling

I have created a Go application that creates UML sequence diagrams from data in a SQL Server database. Across the top of the GoView, I show the nodes that represent the objects in the sequence diagram. I would like to implement something similar to the “Freeze Panes” in Excel so that as my user scrolls vertically, the nodes across the top of the GoView stay in position (as a visual aid). The way I implemented this was to create two GoView instances registered to the same GoDocument. All works fine except for horizontal scrolling. Is there a way I can programatically scroll the “Freeze Panes” GoView horizontally whenver the non-frozen view is scrolled? Would you suggest a better way to accomplish the freeze panes feature?
Thank you,

That sounds pretty good.
You can keep them in horizontal sync by implementing GoView.PropertyChanged event handlers that check for the “DocPosition” property change. It would just need to set the other view’s DocPosition property to the new X position, but using the old Y position.
Hmmm, if you do implement event handlers on both views, and the two views don’t cover the same range horizontally, you might need to make sure there isn’t any infinite loop of trying to set the GoView.DocPosition. The easiest way to do that is to just have a boolean flag to protect the code that sets the other view’s DocPosition.

Thanks Walter, that worked perfectly!


On this freeze pane, can you provide me with a code snippet, I’ve been trying to do the same but just cant get the effect I want.

All the best

email to: superwasabidave AT gmail D0T C0M