ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Spreadsheet functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns or modifies the style of selected cells in a Spreadsheet control found in a window.
Example
// CLICK on [BOLD]
TBLR_Tableur.StyleSelection(psheetBold, True)


// Displays the B1 cell in bold
PSHEET_Spreadsheet.SelectPlus("B1")
TBLR_Tableur.StyleSelection(psheetBold, True)
sRes is boolean = TBLR_Tableur.StyleSélection(psheetBold)
Syntax

Finding out the selection style Hide the details

<Result> = <Spreadsheet control>.StyleSelection(<Attribute>)
<Result>: Type of expected result
Requested attribute.
<Spreadsheet control>: Control name
Name of the Spreadsheet control to be used.
<Attribute>: Integer constant
Attribute to find out:
psheetAlignmentHHorizontal alignment.
In this case, <Result> can correspond to:
  • chCentre centered alignment.
  • chRight Right alignment.
  • chLeft Left alignment.
psheetAlignmentVVertical alignment.
In this case, <Result> can correspond to:
  • cvBas Bottom alignment.
  • cvTop Top alignment.
  • cvMiddle Alignment in the middle.
psheetAutomaticLineWrapAutomatic line wrap.
In this case, <Result> can correspond to:
  • True to use the automatic line wrap,
  • False not to use the automatic line wrap.
psheetBackgroundColorText background color.
In this case, <Result> can correspond to:
psheetBoldBold text in the cell.
In this case, <Result> can correspond to:
  • True to display in bold,
  • False not to display in bold.
psheetFontAngleText rotation angle.
In this case, <Result> can correspond to an integer included between -180 and +180.
psheetFontNameName of font used.
In this case, <Result> can correspond to a character string containing the font name.
psheetFontSizeFont size.
In this case, <Result> corresponds to the font size (integer).
psheetItalicItalicized text in the cell.
In this case, <Result> can correspond to:
  • True to display in italic,
  • False not to display in italic.
psheetStrikeOutStrikethrough text in the cell.
In this case, <Result> can correspond to:
  • True to strike out,
  • False not to strike out.
psheetTextColorText color.
In this case, <Result> can correspond to:
psheetUnderlinedUnderlined text in the cell.
In this case, <Result> can correspond to:
  • True to underline,
  • False not to underline.

Modifying the selection style Hide the details

<Spreadsheet control>.StyleSelection(<Attribute> , <Value>)
<Spreadsheet control>: Control name
Name of the Spreadsheet control to be used.
<Attribute>: Integer constant
Attribute to modify. This element can correspond to:
psheetAlignmentHHorizontal alignment.
In this case, <Value> can correspond to:
  • chCentre centered alignment.
  • chRight Right alignment.
  • chLeft Left alignment.
psheetAlignmentVVertical alignment.
In this case, <Value> can correspond to:
  • cvBas Bottom alignment.
  • cvTop Top alignment.
  • cvMiddle Alignment in the middle.
psheetFontAngleText rotation angle.
In this case, <Value> can correspond to an integer included between -180 and +180.
psheetStrikeOutStrikethrough text in the cell.
In this case, <Value> can correspond to:
  • True to strike out,
  • False not to strike out.
psheetBackgroundColorText background color.
In this case, <Value> can correspond to:
psheetTextColorText color.
In this case, <Value> can correspond to:
psheetBoldBold text in the cell.
In this case, <Value> can correspond to:
  • True to display in bold,
  • False not to display in bold.
psheetItalicItalicized text in the cell.
In this case, <Value> can correspond to:
  • True to display in italic,
  • False not to display in italic.
psheetFontNameName of font used.
In this case, <Value> can correspond to a character string containing the font name.
psheetAutomaticLineWrapAutomatic line wrap.
In this case, <Value> can correspond to:
  • True to use the automatic line wrap,
  • False not to use the automatic line wrap.
psheetUnderlinedUnderlined text in the cell.
In this case, <Value> can correspond to:
  • True to underline,
  • False not to underline.
psheetFontSizeFont size.
In this case, <Value> corresponds to the font size (integer).
<Value>: Variant
Value that will be given to the attribute.
Remarks
  • 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:
The Spreadsheet control 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,
- ...
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/20/2024

Send a report | Local help