Zoom View center

I am simply trying to zoom a GoView to fit and then centre its Document after the zoom is complete.

I originally had a problem with scrollbars after the zoom but found a forum post which resolved the problem which left me with this:

this.Document.Bounds = this.ComputeDocumentBounds();

To centre the document I used:

float left = this.DocPosition.X + ((this.Bounds.Width - this.DocumentSize.Width) / 2);
this.DocPosition = new PointF(left, this.DocPosition.Y);

Unfortunately, the DocPosition would never update… I then found another post which mentioned that I need to set the views ShowsNegativeCoordinates property to false… this works in some scenarios but it others it does not.

Is there a simple way to achieve this that I am missing?

Have you done this anywhere?

goView1.SheetStyle = GoViewSheetStyle.Sheet; // allow scrolling beyond end of document bounds