Group: Forum Members
Last Active: 13 Years Ago
Posts: 25,
Visits: 1
|
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.
|
Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
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;
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 25,
Visits: 1
|
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?
|
Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
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.
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 25,
Visits: 1
|
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.
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 25,
Visits: 1
|
Never mind, I found it. Thanks a bunch as always: nDrawingView1.Document.SizeToContent( new NSizeF(Size), new NMargins(5) );
|