RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TFontDialog.Options Property

Determines the appearance and behavior of the Font dialog.

Pascal
property Options: TFontDialogOptions;
C++
__property TFontDialogOptions Options;

Use the Options property to customize the appearance and functionality of the dialog. Use these flags to indicate which fonts should appear and what controls appear in the dialog. 

By default, all options except fdEffects are off.  

C++ Examples: 

 

/*
This example uses a Font dialog box, a button, and a label
on a form. When the user clicks the button, the Font dialog
box appears. The font sizes available are within the range
of 8 to 14. When the user chooses OK, the selected font is
applied to the caption of the label.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  FontDialog1->Options.Clear();
  FontDialog1->Options << fdLimitSize;
  FontDialog1->MaxFontSize = 14;
  FontDialog1->MinFontSize = 8;
  if (FontDialog1->Execute())
    Label1->Font = FontDialog1->Font;
}

 

Delphi Examples: 

{
This example uses a Font dialog box, a button, and a label
on a form. When the user clicks the button, the Font dialog
box appears. The font sizes available are within the range
of 8 to 14. When the user chooses OK, the selected font is
applied to the caption of the label.
} 
procedure TForm1.Button1Click(Sender: TObject);
begin
  FontDialog1.Options := [fdLimitSize];
  FontDialog1.MaxFontSize := 14;
  FontDialog1.MinFontSize := 8;
  if FontDialog1.Execute then
    Label1.Font := FontDialog1.Font;
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!