ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Spreadsheet functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns or modifies the style of selected cells in a Spreadsheet control found in a window.
Example
// CLIC sur [GRAS]
SpreadsheetStyleSelection(TBLR_Tableur, psheetBold, True)

// Met en gras la cellule B1
SpreadsheetSelectPlus(TBLR_Tableur, "B1")
SpreadsheetStyleSelection(TBLR_Tableur, psheetBold, True)
sRes is boolean = SpreadsheetStyleSelection(TBLR_Tableur, psheetBold)
Syntax

Finding out the selection style Hide the details

<Result> = SpreadsheetStyleSelection(<Spreadsheet control> , <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:
  • haCenter: Centered alignment.
  • haRight: Right alignment.
  • haLeft: Alignment to left.
psheetAlignmentVVertical alignment.
In this case, <Result> can correspond to:
  • vaBottom: Alignment at bottom.
  • vaTop: Alignment at top.
  • vaMiddle: Alignment in the middle.
psheetAutomaticLineWrapManagement of automatic 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 cell text.
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).
psheetItalicItalic cell text.
In this case, <Result> can correspond to:
  • True to display in italic,
  • False not to display in italic.
psheetStrikeOutCell text crossed out.
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 cell text.
In this case, <Result> can correspond to:
  • True to underline,
  • False not to underline.

Modifying the selection style Hide the details

SpreadsheetStyleSelection(<Spreadsheet control> , <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:
  • haCenter: Centered alignment.
  • haRight: Right alignment.
  • haLeft: Alignment to left.
psheetAlignmentVVertical alignment.
In this case, <Value> can correspond to:
  • vaBottom: Alignment at bottom.
  • vaTop: Alignment at top.
  • vaMiddle: Alignment in the middle.
psheetFontAngleText rotation angle.
In this case, <Value> can correspond to an integer included between -180 and +180.
psheetStrikeOutCell text crossed out.
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 cell text.
In this case, <Value> can correspond to:
  • True to display in bold,
  • False not to display in bold.
psheetItalicItalic cell text.
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.
psheetAutomaticLineWrapManagement of automatic 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 cell text.
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 modify operation is added into the list of operations to cancel: 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 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/24/2024

Send a report | Local help