CGridCtrl:AddSheet, CGridView:AddSheet


The AddSheet method adds a sheet to the grid and adds a tab to the tab area below the sheets. By default, a CGridView and CGrid are created with only 1 sheet. After adding sheets, you can rename the sheets tabs using SetTab. This method updates the initial grid property defined by the value of GridParams.nSheets used when creating the CGridView or CGrid.

Syntax

CGridCtrl:AddSheet()

CGridCtrl:AddSheet(strLabel)

bullet.gif    Where strLabel is a label for the new tabbed sheet. if the label is not specified, it can be set using the SetTab method.

The grid below was created with 1 sheet, then a second sheet was added using AddSheet. Afterward, SetTab was used to assign the "old" and "new" names to names to the sheets:

Example

The following script adds a sheet to the CGridView object:

V = new_gridview()

-- attach a grid to the script

G = new_gridctrl(V)

-- create a CGridCtrl for the window

Printf("Sheets= %d\n", G:GetNumSheets())

-- Result: Sheets= 1

G:AddSheet()

-- add a sheet to the grid

Printf("Sheets= %d\n", G:GetNumSheets())

-- Result: Sheets= 2

Related Topics

CGridCtrl class

CGridView class

SetNumCols

SetNumRows

GetNumSheets

SetTab


Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.