Problem with GoView


I'm desenvolving one application that draw a graph. When application starts, the goView and the form have one defined size. When i maximize the window, the goView changes the size. Until here it works very good. But when i do the restore down to window, the goView activates de vertical scroll bar and the goView seems to have more height.
My objective is that the user can't control the vertical scroll bar. I try to hide vertical bar, but the user is able to control the vertical position with the mouse. I could set allowmouse to false but i need the mouse to activate the event objectEnterLeave.
Why does the GoView have this behavior?
Are you saying that the user can drag objects around, and that can cause the scrollbar to appear? If so, you could try setting GoDocument.FixedSize to true.

The objects are fixed to the view. The user can’t drag them. I will try what you said

It works, but it block the horizontal scroll bar to

What do you mean by "objects are fixed to the view"? Have you set GoView (or GoDocument) AllowMove and AllowInsert to false? Or perhaps have you called GoView (or GoDocument) SetModifiable(false)?
If the horizontal scroll bar is visible and enabled, it should still work just fine (assuming your document is wide enough to need a scroll bar, of course). That's true even if you have hidden or disabled or removed the vertical scroll bar.

I set allowMove and allowInsert to false, but i think that it’s not the problem. What I whant is only to fix the vertical size of the document. With FixedSize i fixe all the document.

I can't explain me very good because i don't speek English.
In my graph, the location of the nodes are fixed (each node got a specified position). But when i maximize and restore down the window, the size of the view changes, and the user can move the nodes with the vertical scroll bar or with the mouse.
I think that the resolution of the problem is in fix the height of the document.

OK, then you just need to modify the behavior of GoDocument.UpdateDocumentBounds so that it keeps the current document height but allows the document width to increase as needed.

Here's a modified version of that method, so that it only expands the document bounds horizontally, not vertically:
[code] [Serializable]
public class SpecialDocument : GoDocument {
public SpecialDocument() {}
public override void UpdateDocumentBounds(GoObject obj) {
if (obj == null) return;
if (this.FixedSize) return;
SizeF dim = this.Size;
PointF pnt = this.TopLeft;
RectangleF rect = obj.Bounds;
float newx = Math.Min(pnt.X, rect.X);
float newright = Math.Max(pnt.X + dim.Width, rect.X + rect.Width);
float newwidth = newright - newx;
if (newx < pnt.X) {
this.TopLeft = new PointF(newx, pnt.Y);
if (newwidth > dim.Width){
this.Size = new SizeF(newwidth, dim.Height);
I left the use of the FixedSize property in this override, just as it is in the implementation of this method on GoDocument. You'll want it to be false, the default value.

I apply this method to all objects in the view?

No, use an instance of this document class instead of the one that your GoView uses. Just set GoView.Document = new SpecialDocument() during app initialization.

It works!! Thank’s