Board index » delphi » Changing Default Font

Changing Default Font

Quote
u35...@uicvm.uic.edu wrote:
>Does anyone know how to change the default font for components without
>changing the font property for each or inheriting the component and setting the
>default font desired. For example, on my system it always defaults to System
>but I always use say san serif 8 pt.

From Delphi.hlp

ParentFont Property

Applies to
TBitBtn, TCheckBox, TComboBox, TDBCheckBox, TDBComboBox, TDBEdit,
TDBGrid, TDBImage, TDBLookupCombo, TDBLookupList, TDBListBox, TDBMemo,
TDBRadioGroup, TDBText, TDirectoryListBox, TDrawGrid, TDriveComboBox,
TEdit, TFileListBox, TFilterComboBox, TForm, TGroupBox, THeader,
TListBox, TMaskEdit, TMemo, TNotebook, TOLEContainer, TOutline,
TPaintBox, TPanel, TRadioButton, TScrollBox, TSpeedButton, TStringGrid
components

Declaration
property ParentFont: Boolean;

Description
The ParentFont property determines where a control looks for its font
information. If ParentFont is True, the control uses the font in its
parent component's Font property. If ParentFont is False, the control
uses its own Font property.
By using ParentFont, you can ensure that all the controls on a form
have a uniform appearance.  For example, if you want all the controls
in a form to use 12-point Courier for their font, you can set the
form's Font property to that font. By default, all the controls on
that form will use the same font.
To specify a different font for a particular control, specify the
desired font as the value of the control's Font property, and
ParentFont becomes False automatically.
When the ParentFont is True for a form, the form uses the value of the
application's Font property.

Tom
[cross posting stripped due to religious preference]

 

Re:Changing Default Font


Quote
u35...@uicvm.uic.edu wrote:

: Does anyone know how to change the default font for components without
: changing the font property for each or inheriting the component and setting the
: default font desired. For example, on my system it always defaults to System
: but I always use say san serif 8 pt.

read:  \DELPHI\DOC\INIFILE.TXT

basically to set a default font on a newly created form you would add

DefaultFont=DefaultFont=MS Sans Serif, 8

into the

[FormDesign]

section of your DELPHI.INI file

(located in \windows\ )

Wilhelm

Other Threads