如何实现取当前Windows操作系统使用的Font,及其大小? 如何实现取当前Windows操作系统使用的Font,及其大小? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function GetMenuFontSize: Integer; //字号varncm: TNonClientMetrics;PixelsPerInch: integer;beginncm.cbSize := sizeof(TNonClientMetrics);SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),@ncm,SPIF_UPDATEINIFILE); PixelsPerInch := GetDeviceCaps(GetDC(0), LOGPIXELSY); Result := -MulDiv(ncm.lfMenuFont.lfHeight, 72, PixelsPerInch);end;procedure TForm1.Button1Click(Sender: TObject);//调用begin edit1.Text:=inttostr(GetMenuFontSize);end; combobox1.Items.add(screen.Fonts.GetText); combobox1.Items.Assign(Screen.Fonts);//取系统所有字体 To:jackie168(花好月圓)谢谢你!字体大小是能取出来,那字体类型呢?(如是宋体还是楷体等等) procedure TForm1.Button1Click(Sender: TObject);var i:integer;begin for i:=0 to screen.Fonts.Count-1 do begin combobox1.Items.Add(screen.Fonts.Strings[i]); end;end; procedure TForm1.Button1Click(Sender: TObject);begin Memo1.Lines.Values['Screen.MenuFont.Size'] := IntToStr(Screen.MenuFont.Size); Memo1.Lines.Values['Screen.MenuFont.Name'] := Screen.MenuFont.Name; Memo1.Lines.Values['Screen.HintFont.Size'] := IntToStr(Screen.HintFont.Size); Memo1.Lines.Values['Screen.HintFont.Name'] := Screen.HintFont.Name; Memo1.Lines.Values['Screen.IconFont.Size'] := IntToStr(Screen.MenuFont.Size); Memo1.Lines.Values['Screen.IconFont.Name'] := Screen.MenuFont.Name;end 放分,请按要求给一段源代码,关于读有类型文件的 请问怎么在Treeview中给节点加上Checkbox? 怎样在panel上加滚动条,显示一屏显示不下的内容? 帮忙看看这段程序有什么错误 哪位大侠在比较完善的树形和形表视图的维护、显示的例子? 文件更名 如何实现把多个bmp文件生成一个多页的tif文件? TTable 的 排序问题 求几本学delphi的书~~~~~~~~~ 怎么看手机三包? 一段关于在form 窗口中写字 的代码,为什么不行?? 用adoquery或adotable取得的结果集能否如后台表功能一样做第二次查询?如果能,该怎么写编码?
var
ncm: TNonClientMetrics;
PixelsPerInch: integer;
begin
ncm.cbSize := sizeof(TNonClientMetrics);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(NONCLIENTMETRICS),@ncm,SPIF_UPDATEINIFILE);
PixelsPerInch := GetDeviceCaps(GetDC(0), LOGPIXELSY);
Result := -MulDiv(ncm.lfMenuFont.lfHeight, 72, PixelsPerInch);
end;procedure TForm1.Button1Click(Sender: TObject);//调用
begin
edit1.Text:=inttostr(GetMenuFontSize);
end;
谢谢你!字体大小是能取出来,那字体类型呢?(如是宋体还是楷体等等)
var i:integer;
begin
for i:=0 to screen.Fonts.Count-1 do
begin
combobox1.Items.Add(screen.Fonts.Strings[i]);
end;
end;
begin
Memo1.Lines.Values['Screen.MenuFont.Size'] := IntToStr(Screen.MenuFont.Size);
Memo1.Lines.Values['Screen.MenuFont.Name'] := Screen.MenuFont.Name; Memo1.Lines.Values['Screen.HintFont.Size'] := IntToStr(Screen.HintFont.Size);
Memo1.Lines.Values['Screen.HintFont.Name'] := Screen.HintFont.Name; Memo1.Lines.Values['Screen.IconFont.Size'] := IntToStr(Screen.MenuFont.Size);
Memo1.Lines.Values['Screen.IconFont.Name'] := Screen.MenuFont.Name;
end