Nevron Forum

SizeToContent Reset to Normal

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

By Volvick Derose 1 - Tuesday, February 8, 2011


nDrawingDocument.SizeToContent(nDrawingDocument.AutoBoundsMinSize, nDrawingDocument.AutoBoundsPadding, NFilters.Visible);

After using SizeToContent to size the document on the screen, I couldn't find a way to go back to normal. How to get back to normal after using this command?
By Nevron Support - Wednesday, February 9, 2011

Hi Volvick,

please clarify what do you mean by "normal".

By Volvick Derose 1 - Wednesday, February 9, 2011

I mean reset it to normal the way it was. For instance, by resizing to content, the drawing becomes smaller to fit in the screen. Now I want to reset to normal the way it was at the beginning.
By Nevron Support - Thursday, February 10, 2011

Hi Volvick,

The easiest way to restore the document after you have called the SizeToContent method is to use the Undo feature of the document’s history service:

 

if (document.HistoryService.CanUndo())

      document.HistoryService.Undo();

By Volvick Derose 1 - Friday, February 11, 2011

Thanks, I thought there was another way beside that