|
|
|
|
|
- Available masks
- Defining a mask on a column
- Miscellaneous
<Spreadsheet>.TypeAndMaskSelection (Function) In french: <Tableur>.TypeEtMasqueSélection Returns or modifies the type and the mask of selected cells in a Spreadsheet control found in a window. Note This function can be used, for example, to create a formatting toolbar for a Spreadsheet control.
PSHEET_Spreadsheet.TypeAndMaskSelection(typInputNum, "999 999 999,99")
PSHEET_Spreadsheet.TypeAndMaskSelection(typInputDate, "DDD D MMMM YYYY")
sRes is string
nType is int
sMask is string
sRes = PSHEET_Spreadsheet.TypeAndMaskSelection()
nType = Val(ExtractString(sRes, 1, TAB))
sMask = Val(ExtractString(sRes, 2, TAB))
Syntax
Finding out the type and mask of selected cells Hide the details
<Result> = <Spreadsheet control>.TypeAndMaskSelection()
<Result>: Character string Mask of selected cells. This mask has the following format: - <Type> corresponds to one of the following constants:
| | typInputCurrency | Currency type | typInputDate | Date type | typInputDuration | Duration type | typInputNum | Numeric type (integer, real, ...) | typInputText | Text type | typInputTime | Time type |
- <Mask> corresponds to the mask used.
<Spreadsheet control>: Control name Name of the Spreadsheet control to be used.
Modifying the type and mask of selected cells Hide the details
<Spreadsheet control>.TypeAndMaskSelection(<Type> , <Mask>)
<Spreadsheet control>: Control name Name of the Spreadsheet control to be used. <Type>: Integer constant New type for the selected cell: | | typInputCurrency | Currency type | typInputDate | Date type | typInputDuration | Duration type | typInputNum | Numeric type (integer, real, ...) | typInputText | Text type | typInputTime | Time type |
<Mask>: Character string New mask to use (the mask depends on the selected type). Remarks Available masks The available masks depend on the type of mask. All masks that can be used with InputMask are available. For more details, see the help on the InputMask property. For example: - on a date: you can use the "DD/MM/YYYY" mask.
- on a Numerical: you can use the "999 999" mask.
Remarks: - (typInputText, "") means "no mask".
- The mask defined by <Spreadsheet>.TypeAndMaskSelection can be modified by InputMask.
Warning: only the mask can be modified, the cell type is not modified..
Defining a mask on a column To define a mask on a column, all you have to do is select the column and apply the requested mask. Example: PSHEET_NoName1.SelectPlus("A")
PSHEET_NoName1.TypeAndMaskSelection(typInputDate, "DD-MM-YY")
Miscellaneous - The modification operation is added to the list of operations to be undone: the user can undo this operation via the context menu or by pressing Ctrl + Z.
- This function can only be used on a Spreadsheet control found in a window.
Related Examples:
|
Unit examples (WINDEV): The Spreadsheet control
[ + ] Using the Spreadsheet control. This example explains how to: - load an xlsx file in a spreadsheet control, - save the spreadsheet in a file, - fill the control with data coming from the database, - insert rows, columns, - access the cells and handle them (modify their value, their style, ...), - enter formulas, - ...
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|