Docs HotXLS

AddTextBox-method

Ajoute une zone de texte de dessin XLS classique à partir d'ancres de feuille basées sur 1 et renvoie le TXLSTextBox object

Syntaxe

function AddTextBox(AText: WideString; ARow1, ACol1, ARow2, ACol2: Integer): TXLSTextBox;
function AddTextBox(AText: WideString; ARange: WideString): TXLSTextBox;
    

Paramètres

AText Initial text stored in the text box
ARow1, ACol1 One-based row and column for the upper-left anchor
ARow2, ACol2 One-based row and column for the lower-right anchor
ARange A1-style worksheet range such as C4:F8

Remarques

AddTextBox est un raccourci au niveau feuille pour créer une forme de dessin autonome via la Shapes collection
La méthode ne crée pas de commentaire de cellule et n'attache pas de texte à un enregistrement de note de cellule

Exemple

var
  TextBox: TXLSTextBox;
begin
  TextBox := Workbook.Sheets[1].AddTextBox(
    'Standalone note',
    2, 3,
    5, 7);
  TextBox.Fill.ForeColor.RGB := $00FFFF;

  TextBox := Workbook.Sheets[1].AddTextBox(
    'Range note',
    'C4:F8');
end;
    

Voir aussi

TXLSWorksheet class
TXLSWorksheet.Shapes propriété
TXLSShapes.AddTextBox méthode
TXLSTextBox class