procedure TFormX.FontComboBoxDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
FontCombo : TComboBox;
FontName : string;
FontRect : TRect;
begin
FontCombo := TComboBox(Control);
FontName := FontCombo.Items[index];
FontRect := Rect;
with FontCombo.Canvas do
begin
Font.Size := 9;
Font.Name := FontName;
FillRect(Rect);
inc(FontRect.Left, 2);
inc(FontRect.Top, ((Rect.Bottom-Rect.Top) - TextHeight('°_,ʲ')) shr 1);
TextRect(Rect, FontRect.Left, FontRect.Top, FontName);
end;
end;
procedure TFormX.FormCreate(Sender: TObject);
begin
FontComboBox.Style := csOwnerDrawVariable;
FontComboBox.ItemHeight := 16;
FontComboBox.Items.Assign(Screen.Fonts);
FontComboBox.ItemIndex := 0;
end;