Autor Beitrag
ralfi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 153



BeitragVerfasst: Di 29.07.03 15:13 
Hallo!

Wie kann ich alle Systemfonts in eine ComboBox laden?
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 29.07.03 16:03 
In den LMD-Tools gibts eine Font-ComboBox, das müsste doch eigentlich reichen oder?
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 29.07.03 16:15 
Hallo,

die Fonts kannst du über das Screen Objekt auslesen.

Einfach auf Screen.Fonts zugreifen.

Gruß
Klabautermann
Cyrus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Di 29.07.03 16:17 
so ghet das :


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric; 
  FontType: Integer; Data: Pointer): Integer; stdcall; 
begin 
  TStrings(Data).Add(LogFont.lfFaceName); 
  Result := 1; 
end; 

procedure TForm1.Button1Click(Sender: TObject); 
var 
  DC: HDC; 
begin 
  DC := GetDC(0); 
  EnumFonts(DC, nil, @EnumFontsProc, Pointer(ComboBox1.Items)); 
  ReleaseDC(0, DC); 
  ComboBox1.Sorted := True; 
end;


Greetz Cyrus
Ps. Frag nicht in mehreren Foren das selbe (ausser es kann dir dort niemand helfen)

_________________
Wer glaub er ist, hört auf zu werden!
Delphi Rulez!!!
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 29.07.03 16:30 
Hi,
Cyrus hat folgendes geschrieben:
so ghet das :

also
Combobox1.Items.Assign(Screen.Fonts);
finde ich immernoch einfacher ;).

Nichts für ungut.

Gruß
Klabautermann