Nevron Forum

Shapes Layout

https://www.nevron.com/Forum/Topic3794.aspx

By Luis Mendes - Tuesday, July 6, 2010

I am attaching a picture trying to better explain my problem.  Basically I have a diagram and the diagram shapes are completely off the screen. See the rectangles W and C, they are pointing to other rectangles are off of the drawing view. Is there a way to tell the diagram control to fit all shapes in the drawing view? I will add the option to zoom in/out afterwards, but I would like to start with all the shapes visiable.
By Nevron Support - Wednesday, July 7, 2010

Hi,

You can esily size the document and zoom it so that all of its content is visible. All you need are 2 lines of code:

 

document.SizeToContent();

view.ViewLayout = ViewLayout.Fit;

 

By Luis Mendes - Wednesday, July 28, 2010

Thanks. But it doesn't solve my problem. I want the white area (the view I guess) to cover the entire hosting control. I tried all the options from ViewLayout but cannot figure it out. Anyhelp?

By Nevron Support - Thursday, July 29, 2010

Hi,

In that case we recommend you set the ScrollBars property of the view to none, subscribe to the Resize event of the view and resize the document to the size of the view in there.

By Luis Mendes - Thursday, September 2, 2010

Thanks, can you give me a sample code on how to size the document to the size of the view? The document has no Size property. Thanks in advance.

 

By Luis Mendes - Thursday, September 2, 2010

Never mind, I found it. Thanks a bunch as always:

nDrawingView1.Document.SizeToContent(new NSizeF(Size), new NMargins(5) );