Aller au contenu principal
Version: 20 R6

VP SET CELL STYLE

VP SET CELL STYLE ( rangeObj : Object ; styleObj : Object)

ParamètresTypeDescription
rangeObjObject->Objet plage
styleObjObject->Objet style

Description

The VP SET CELL STYLE command applies the style(s) defined in the styleObj to the cells defined in the rangeObj.

In rangeObj, pass a range of cells where the style will be applied. If the rangeObj contains multiple cells, the style is applied to each cell.

Borders applied with VP SET CELL STYLE will be applied to each cell of the rangeObj, as opposed to the VP SET BORDER command which applies borders to the rangeObj as a whole.

The styleObj parameter lets you pass an object containing style settings. Vous pouvez utiliser une feuille de style existante ou créer un nouveau style. If the styleObj contains both an existing style sheet and additional style settings, the existing style sheet is applied first, followed by the additional settings.

Attribuez la valeur NULL pour supprimer un style et rétablir les paramètres de style par défaut (le cas échéant) :

  • giving the styleObj parameter a NULL value will remove any style settings from the rangeObj,
  • giving an attribute a NULL value will remove this specific attribute from the rangeObj.

For more information about style objects and style sheets, see the Style Objects paragraph.

Exemple

$style:=New object
$style.font:="8pt Arial"
$style.backColor:="Azure"
$style.foreColor:="red"
$style.hAlign:=1
$style.isVerticalText:=True
$style.borderBottom:=New object("color";"#800080";"style";vk line style thick)
$style.backgroundImage:=Null //remove a specific attribute

VP SET CELL STYLE(VP Cell("ViewProArea";1;1);$style)

Voir également

VP ADD STYLESHEET
VP Font to object
VP Get cell style
VP Object to font
VP SET BORDER
VP SET DEFAULT STYLE