GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoView Class / CreateSheet Method
Example
In This Topic
    CreateSheet Method (GoView)
    In This Topic
    This method is called by the constructor to create a page object for this view.
    Syntax
    public virtual GoSheet CreateSheet()

    Return Value

    a GoGroup including a bounded, shadowed GoGrid filled with the GoDocument.PaperColor positioned at the origin.
    Remarks
    If you need to use your own subclass of GoSheet, this is one natural place to create it if you create more than one view. Otherwise you can just set the Sheet property.

    The BackgroundHasSheet setter will automatically call this method and set the Sheet property, which will add that sheet to this view's background layer, as if: this.BackgroundLayer.Add(s);

    Example
    By default this does:
    public virtual GoSheet CreateSheet() {
      GoSheet sheet = new GoSheet();
      sheet.Visible = (this.SheetStyle != GoViewSheetStyle.None);
      sheet.Printable = false;
      sheet.Selectable = false;
      // the following three lines are executed only in WinForms, in a try-catch:
        PrintDocument pd = new PrintDocument();
        PageSettings ps = pd.DefaultPageSettings;
        sheet.UpdateBounds(ps, this.PrintScale);
      GoRectangle paper = sheet.Paper;
      Color color = this.Document.PaperColor;
      if (color == Color.Empty)
        color = Color.White;
      paper.BrushColor = color;
      return sheet;
    }
    See Also