please help me solve this one : I got 2 goview diagrams open in a MDI application on diagram 1 I zoom in in with the mousewheel on a object, when I switch to diagram 2 and back to diagram 1 the diagram zoomed out again. how can I make the diagrams to stay on the zoomed level when I am switching windows?
You should be able to… set breakpoints at all the places you set DocScale / RescaleToFit / RescaleWithCenter in your code to see if it is something happening that you don’t expect.
In other words, each GoView has its own GoView.DocScale property.
Perhaps some event handler of yours is setting the DocScale property for both of the views.
I cant find any code that modify my DocScale,could it be that it behaves like this because of the GoDrawView control?
ok, try this. Set up and Event Handler for PropertyChanged on your GoView, and set a breakpoint there.
if (e.PropertyName == "DocScale")
toolStripStatusLabel1.Text = this.goView1.DocScale.ToString();
It look like it is when the windowposchanged. is there any way I can prvent this?
Are you swapping one GoView for another? Is that why you are changing the window position?
I got two windows with a goview on, the windows is in tab controls, as i swap back and forth between the windows if resize itself. I also have dockable tabs in the windows and as soon as I undock or dock the tabs the resize event is fired. Any solutions?
RescaleWithCenter is being called in UpdateExtent because you must have GoView.SheetStyle set to something other than GoViewSheetStyle.None.
hi Jake - you are correct my GoDrawview is in the following mode
Me.myView.SheetStyle = Northwoods.Go.GoViewSheetStyle.Sheet
Jake - I am not sure if it is the correct way to do it, I added the following code:
Actually, GoView.UpdateExtent is what is responsible for deciding the appropriate behavior whenever the view’s size has changed.
When GoView.SheetStyle is not None, that method calls RescaleWithCenter to carry out the standard behavior.
So although it might work fine in your case, it might be “better” to override UpdateExtent instead, and have it be a no-op if some new flag of yours is set. That way you and other code can still call RescaleWithCenter whenever needed.