ComboBox1.Items := Screen.Fonts;

解决方案 »

  1.   

    将ComboBox1的Style属性设为csOwnerDrawFixed;procedure TForm1.FormCreate(Sender: TObject);
    begin
      ComboBox1.Items.Assign(Screen.Fonts);
    end;procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
    begin
      with ComboBox1 do
      begin
        Canvas.FillRect(Rect);
        Canvas.Font.Name := Items[Index];
        Canvas.TextOut(Rect.Left + 2, Rect.Top + 2, Items[Index]);
      end;
    end;
      

  2.   

    EnumFontFamilies(DC, nil, @EnumFontsProc, Integer(Pointer(ComboBox1.Items)))
      

  3.   

    function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
      FontType: Integer; Data: Pointer): Integer; stdcall;
    begin
      TStrings(Data).Add(LogFont.lfFaceName);
      Result := 1;
    end;
      

  4.   

    ComboBox1.Items := Screen.Fonts;