Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSpreadSheetCustomFont.Name Property

Specifies the font’s typeface name.

#Declaration

Delphi
property Name: TFontName read; write;

#Property Value

Type
TFontName

#Remarks

Use this property to set the font typeface. If the specified font family includes multiple character sets, be sure to set the Charset property as well.

The following code example demonstrates how to use the Name property.

var
  ATableView: TdxSpreadSheetTableView;
  ACell: TdxSpreadSheetCell;
  AFont: TdxSpreadSheetCellFont;
  I: Integer;
const
  AFontNames: array [0..3] of string = ('Impact', 'Courier New', 'Comic Sans MS', 'Bookman Old Style');
//...
  ATableView := TdxSpreadSheetTableView(dxSpreadSheet1.ActiveSheet);
  for I := 0 to 3 do
    begin
      ACell := ATableView.CreateCell(I, 0);
      AFont := ACell.Style.Font;
      AFont.Name := AFontNames[I];
      AFont.Size := 12;
    end;

To allow end-users to change the font typeface in the currently selected cells, you can link the ChangeFontName command to an element of your UI.

See Also